View Single Post
Posts: 726 | Thanked: 345 times | Joined on Apr 2010 @ Sweden
#10
nicolai beat me to it.

Just as he pointed out, you have no instruction to the linker to look in liblocation for symbols that will satisfy the function calls in your code.

The flag -l means "Add this library to the list of libraries to look for symbols in.".

The flag -L means "Look in this directory for libraries to use while linking.".

So, in this case, the combination
Code:
-L/user/lib -llocation
will instruct the linker to look in /usr/lib for something that matches "liblocation.so.*". In most cases you don't have to supply the "-L/usr/lib" flag since the compiler has been instructed to look there by the people that configured it.

Happy (hacking|linking)!

Last edited by Joorin; 2010-04-28 at 09:13. Reason: Typo
 

The Following User Says Thank You to Joorin For This Useful Post: