Library linking problem
Hi,
I am new to linux and actually also for some extend to programming. I'm having a problem linking a C library to my C code. The library .a files are in the folder /home/glenn/SOEM1.2.8/lib/linux (libsoem.a) The header files are in the folder /home/glenn/SOEM1.2.8/soem After some google searching I thought I could compile my code like this: gcc -o soem_functions -I/home/glenn/SOEM1.2.8/soem -L/home/glenn/SOEM1.2.8/lib/linux -lsoem soem_function.c But I am having "undefined reference to" errors for the functions in this library. I don't see what I'm doing wrong here, can someone help me out ? Thanks. |
you should change the order of the files: first comes the .c, and last the lib -lsoem
|
That did the trick, rookie mistake, thanks.
|
All times are GMT -5. The time now is 10:10 PM. |