Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » linker cannot find library
linker cannot find library [message #249229] Mon, 18 February 2008 20:56 Go to next message
Eclipse UserFriend
Originally posted by: steveathome3.hotmail.com

Hi folks,
I'm an experienced user under and ARC context, but I'm setting up with
mingw.

using:
Eclipse Version: 3.3.1.1
CDT 4.0.2
GNU C++ version 3.4.5 (mingw special) (mingw32)

I built the stock Hello World with no problems and added a second
"utilities" static library project for practice. I did the following:
* checked "utilities" as a project reference for Hello World.
* added libutilities as as a lbrary to "Hello World" project library list.
* added "${workspace_loc:/utilities/Debug}" as the dir path for libs.
(libutilities.a lives there). (also tried the "file system" version of
this.
* Clean and build results in the following error:

g++ -LC:\projects\fargo\utilities\Debug -ohello_world.exe
src\hello_world.o src\c_template_class.o -llibutilities
C:\mingw\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\mingw32\bi n\ld.exe:
cannot find -llibutilities
collect2: ld returned 1 exit status

* Seems pretty basic - hoping it's just some idiot setup thing I'm doing.
Any ideas much appreciated.

Regards,
Steve
Re: linker cannot find library [message #249241 is a reply to message #249229] Mon, 18 February 2008 21:32 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: porges.comcast.net

"steve waller" <steveathome3@hotmail.com> wrote in message news:94e1bc3cbd2fc21409623f160e99b353$1@www.eclipse.org...
> Hi folks,
> I'm an experienced user under and ARC context, but I'm setting up with mingw.
>
> using:
> Eclipse Version: 3.3.1.1
> CDT 4.0.2
> GNU C++ version 3.4.5 (mingw special) (mingw32)
>
> I built the stock Hello World with no problems and added a second "utilities" static library project for practice. I
> did the following:
> * checked "utilities" as a project reference for Hello World. * added libutilities as as a lbrary to "Hello World"
> project library list.
> * added "${workspace_loc:/utilities/Debug}" as the dir path for libs. (libutilities.a lives there). (also tried the
> "file system" version of this.
> * Clean and build results in the following error:
>
> g++ -LC:\projects\fargo\utilities\Debug -ohello_world.exe src\hello_world.o src\c_template_class.o -llibutilities
> C:\mingw\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\mingw32\bi n\ld.exe: cannot find -llibutilities
> collect2: ld returned 1 exit status
>
> * Seems pretty basic - hoping it's just some idiot setup thing I'm doing. Any ideas much appreciated.

Don't you want "-lutilities" rather than "-libutilities"?
Re: linker cannot find library [message #249246 is a reply to message #249241] Mon, 18 February 2008 21:45 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: steveathome3.hotmail.com

Hello Don,
Thanks for your reply.
I gave this some scrutiny previously, but I think it's OK for the
following reason...

For the utilities project, the properties | C/C++ Build settings | Build
Artifact tab has an output prefix that defaults to "lib". And I have
verified that the utilities library is indeed built with filename
"libutilities.a". So unfortunatley I think that part is OK.

Thanks much,
Steve
Re: linker cannot find library [message #249259 is a reply to message #249229] Mon, 18 February 2008 22:57 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse-news.rizzoweb.com

Moving this over to the CDT newsgroup where it will get more attention.

steve waller wrote:
> Hi folks,
> I'm an experienced user under and ARC context, but I'm setting up with
> mingw.
>
> using:
> Eclipse Version: 3.3.1.1
> CDT 4.0.2
> GNU C++ version 3.4.5 (mingw special) (mingw32)
>
> I built the stock Hello World with no problems and added a second
> "utilities" static library project for practice. I did the following:
> * checked "utilities" as a project reference for Hello World. * added
> libutilities as as a lbrary to "Hello World" project library list.
> * added "${workspace_loc:/utilities/Debug}" as the dir path for libs.
> (libutilities.a lives there). (also tried the "file system" version of
> this.
> * Clean and build results in the following error:
>
> g++ -LC:\projects\fargo\utilities\Debug -ohello_world.exe
> src\hello_world.o src\c_template_class.o -llibutilities
> C:\mingw\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\mingw32\bi n\ld.exe:
> cannot find -llibutilities
> collect2: ld returned 1 exit status
>
> * Seems pretty basic - hoping it's just some idiot setup thing I'm
> doing. Any ideas much appreciated.
>
> Regards,
> Steve
>
>
>
Re: linker cannot find library [message #249275 is a reply to message #249246] Tue, 19 February 2008 09:07 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dmsubs.NOSPAM.consertum.com

"-llibutilities" will cause the linker to look for a file called
"liblibutilities.a" down the library search path (you can see where it is
searching with "-Xlinker --verbose" on the linker command line).

As Don said, if you want to include "libutilities.a" you use "-lutilities".

--
Derek


steve waller wrote:
> Hello Don,
> Thanks for your reply. I gave this some scrutiny previously, but I
> think it's OK for the following reason...
>
> For the utilities project, the properties | C/C++ Build settings | Build
> Artifact tab has an output prefix that defaults to "lib". And I have
> verified that the utilities library is indeed built with filename
> "libutilities.a". So unfortunatley I think that part is OK.
>
> Thanks much,
> Steve
>
Re: linker cannot find library [message #249460 is a reply to message #249275] Wed, 20 February 2008 04:46 Go to previous message
Eclipse UserFriend
Originally posted by: steveathome3.hotmail.com

Hello Don and Derek,
Apologies - it finally struck me what your suggestion really meant!

I changed from "libutilities" to "utilities" in the "Hello World" project
library list and all is well.

Thanks, much appreciated!
Steve
Previous Topic:Mac: Eclipse causing 100% CPU due to syslogd writes
Next Topic:Hardware requirement
Goto Forum:
  


Current Time: Sun Jul 21 17:23:52 GMT 2024

Powered by FUDForum. Page generated in 0.10527 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top