How to link a lib?
Hi there!
I've got a little question about something really essential... nOObiE - Question When I want to use a library... delivered with a programm (in my case this is a lib delivered with gpsd)... how do I do this exactly? I have a file ... the lib itself... where do I have to put it? Is it enough put put it into the compiling directory? And then I habe to link against it in some way... or not? Thanks a lot,.. greetings, Sascha |
A .so file ( the library itself ) is usually in /usr/lib, to link your program to it you pass options on the command line when compiling you have to pass a library path with -L and the actual lib with -l without the .so extension.
-L /usr/lib -lthelib |
Ok,.. that sou8nds easy...
How about placing the lib in the directory, in which I compile to prgramm? Is that possible? If so, I think I can let the -L /path/to/lib/ away? Thanks very much! GReetings, Sascha |
It is possible, just make sure the lib file is not a symlink. But I think you will need the -l option though.
|
All times are GMT -5. The time now is 08:37 PM. |