Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » CDT » g++ Linking problem(Eclipse G++ compiler cannot link a library)
g++ Linking problem [message #808582] Mon, 27 February 2012 18:24 Go to next message
Missing name Missing name is currently offline Missing name Missing name
Messages: 7
Registered: February 2010
Junior Member
Hi,

I am trying to build a piece of code on 64 bit linux machine gcc ( ++ compiler ) on eclipse IDE

In the linking stage,it throws an error

Invoking: GCC C++ Linker
g++ -L/home/Docs/test1/ -o"test" ./main.o ./wrapper.o -lmylib64
/usr/bin/ld: cannot find -lmylib64
collect2: ld returned 1 exit status

I have included the library in the workfolder and tried giving full path name,absolute path etc..no success..
( The name of the library is mylib64.a)


I am using eclipse version 3.5 .

Any suggestions?

Thanks.
Re: g++ Linking problem [message #808876 is a reply to message #808582] Tue, 28 February 2012 03:45 Go to previous messageGo to next message
Axel Mueller is currently offline Axel Mueller
Messages: 1823
Registered: July 2009
Senior Member
The linker expects the library name to be libmy.a. Your command line would then be "-lmy". You should rename your library (to use the name scheming everybofy on this planet uses) or change the command to
-l /home/Docs/test1/mylib64.a


see http://gcc.gnu.org/onlinedocs/gcc-4.6.2/gcc/Link-Options.html#Link-Options


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: g++ Linking problem [message #808970 is a reply to message #808876] Tue, 28 February 2012 05:38 Go to previous messageGo to next message
Kevin Ostheimer is currently offline Kevin Ostheimer
Messages: 4
Registered: February 2012
Location: Germany
Junior Member
Perhaps this might help you: eclipse.org/forums/index.php/t/300012/
Re: g++ Linking problem [message #809241 is a reply to message #808970] Tue, 28 February 2012 11:27 Go to previous messageGo to next message
Missing name Missing name is currently offline Missing name Missing name
Messages: 7
Registered: February 2010
Junior Member
Thanks Guys. This solved the issue.
Re: g++ Linking problem [message #809245 is a reply to message #809241] Tue, 28 February 2012 11:31 Go to previous message
Missing name Missing name is currently offline Missing name Missing name
Messages: 7
Registered: February 2010
Junior Member


.

[Updated on: Tue, 28 February 2012 11:48]

Report message to a moderator

Previous Topic:[SOLVED] simple linker problem
Next Topic:Internal Builder customized command line
Goto Forum:
  


Current Time: Sun May 19 20:56:43 EDT 2013

Powered by FUDForum. Page generated in 0.06801 seconds