LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Have problem with link library in eclipse for linux (https://www.linuxquestions.org/questions/programming-9/have-problem-with-link-library-in-eclipse-for-linux-673704/)

ShrewMouse84 10-02-2008 04:58 AM

Have problem with link library in eclipse for linux
 
Hi all,

currently I use eclipse to write an application with poco library. I already built Poco lib into /usr/local/ folder. There are errors occurs when I compile:
g++ -L/usr/local/lib -o"PocoLib" ./Poco.o -llibPocoFoundationd

/usr/bin/ld: cannot find -llibPocoFoundationd
collect2: ld returned 1 exit status

So what is my problem and how to fix it

thanks for any help

paulsm4 10-02-2008 10:40 AM

Hi -

Assuming the name of the library is something like this:

"libPocoFoundationd.so"

then your link command needs to look like this:

"-lPocoFoundationd"

In other words, the "-l" should *not* include either "lib" or the file suffix (.so or .a).

'Hope that helps .. PSM

PS:
You'll often need one or more "-L" switches to specify the library search path. You've already got one, and I presume your "PocoFoundationd" lib is actually in "/usr/local/lib".

ShrewMouse84 10-02-2008 10:40 PM

Hi paulsm4,
you're right, in /usr/local/lib there are 2 file: libPocoFoundationd.so and libPocoFoundationd.so.5
when I change to "-lPocoFoundationd", it works fine!

thanks so much


All times are GMT -5. The time now is 09:40 AM.