ZoOo ZoOo - 1 year ago 84
Linux Question

usr/bin/ld: cannot find -l<nameOfTheLibrary>

I'm trying to compile my program and it returns this error :

usr/bin/ld: cannot find -l<nameOfTheLibrary>

in my makefile I use the command
and link to my library which is a symbolic link to my library located on an other directory.

Is there an option to add to make it work please?

Answer Source

If your library name is say libxyz.so` and it is located on path say:


then to link it to your program:

g++ -L/home/user/myDir -lxyz myprog.cpp -o myprog
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download