Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » make error with -l library flag
make error with -l library flag [message #1001009] Tue, 15 January 2013 21:13 Go to next message
Ray Mitchell is currently offline Ray MitchellFriend
Messages: 2
Registered: January 2013
Junior Member
Hello,

I'm using Eclipse CDT on Ubuntu with the standard Linux GCC Toolchain and I need to link in the math library. Using the -l linker flag does eliminate the "unresolved reference" errors for the math library function calls in my code but whenever I do use the -l linker flag I get the following:

Building target: Ex15a
Invoking: GCC C Linker
gcc -l -o "Ex15a" ./Ex15a1_main.o
gcc: error: Ex15a: No such file or directory
make: *** [Ex15a] Error 1

Thanks,
Ray

[Updated on: Tue, 15 January 2013 23:29]

Report message to a moderator

Re: make error with -l library flag [message #1001233 is a reply to message #1001009] Wed, 16 January 2013 09:42 Go to previous messageGo to next message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1973
Registered: July 2009
Senior Member
The linker flag "-l" needs the name of the lib! In your case it is "m"

Please follow the instructions here
http://wiki.eclipse.org/CDT/User/FAQ#How_do_I_add_an_external_library_to_my_C.2B.2B_project.3F


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: make error with -l library flag [message #1001486 is a reply to message #1001233] Wed, 16 January 2013 20:12 Go to previous message
Ray Mitchell is currently offline Ray MitchellFriend
Messages: 2
Registered: January 2013
Junior Member
Thanks for your help. I tried the first two solutions but neither worked. Thankfully the third solution did work.
Previous Topic:copy Cygwin Toolchain
Next Topic:Problem with custom build step
Goto Forum:
  


Current Time: Tue Mar 19 03:57:47 GMT 2024

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

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

Back to the top