debugcppCritical
usr/bin/ld: cannot find -l<nameOfTheLibrary>
Viewed 0 times
usrfindnameofthelibrarycannotbin
Problem
I'm trying to compile my program and it returns this error :
in my makefile I use the command
Is there an option to add to make it work please?
usr/bin/ld: cannot find -lin my makefile I use the command
g++ 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?
Solution
If your library name is say
then to link it to your program:
libxyz.so and it is located on path say:/home/user/myDirthen to link it to your program:
g++ -L/home/user/myDir -lxyz myprog.cpp -o myprogCode Snippets
/home/user/myDirg++ -L/home/user/myDir -lxyz myprog.cpp -o myprogContext
Stack Overflow Q#16710047, score: 257
Revisions (0)
No revisions yet.