LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-02-2008, 04:58 AM   #1
ShrewMouse84
LQ Newbie
 
Registered: Oct 2008
Posts: 2

Rep: Reputation: 0
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
 
Old 10-02-2008, 10:40 AM   #2
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
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".
 
Old 10-02-2008, 10:40 PM   #3
ShrewMouse84
LQ Newbie
 
Registered: Oct 2008
Posts: 2

Original Poster
Rep: Reputation: 0
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Hot to set Eclipse to link to dll files ? barbuceanu Linux - Software 0 05-12-2008 05:49 PM
LXer: Openlogic Open Source Library Supports Eclipse and JBoss LXer Syndicated Linux News 0 12-17-2006 09:21 PM
Link ACE to Eclipse sidra Programming 0 05-24-2006 01:47 PM
problem about GD library link to PHP arcow Linux - Software 4 02-03-2006 02:09 AM
Problem installing - libtool: link: cannot find the library `__LIBGL_PATH__/libGL.la' sparX CG Linux - Software 4 11-14-2005 05:45 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration