Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » mingw32/bin/ld.exe: cannot find -lCImg
mingw32/bin/ld.exe: cannot find -lCImg [message #840074] Mon, 09 April 2012 16:27 Go to next message
Daniela Ramsauer is currently offline Daniela RamsauerFriend
Messages: 1
Registered: April 2012
Junior Member
I am trying to include an image library to eclipse... but just get following error message:
g++ -LC:\MinGW -LC:\librariesC\CImg149 -oCImgSd.exe CImgSd.o -lCImg
c:/mingw/bin/../lib/gcc/mingw32/4.6.1/../../../../mingw32/bin/ld.exe: cannot find -lCImg

I already added the library search paths, where the 1. MinGw and 2. CImg files are, in Project properties - C/C++Build - Settings

First in GCC C++ Compiler - includes
second in GCC C Compiler - includes
third in MinGW C++ Linker - libraries

Furthermore I added the name of of the lib file 'CImg' to the second and third.

The file it should find is 'CImg.h' and it is placed in the C:\MinGW -LC:\librariesC\CImg149 folder.

Someone knows what's wrong, because I'm googling for three days right now and tried many things but nothing worked out...

edit: I am using windows7 and added C:\MinGW\bin to the path variable
Or is it maybe a mingw problem, someone knows a better C++ Compiler, which I can use easily with an image processing library?

[Updated on: Mon, 09 April 2012 17:17]

Report message to a moderator

Re: mingw32/bin/ld.exe: cannot find -lCImg [message #840614 is a reply to message #840074] Tue, 10 April 2012 09:50 Go to previous messageGo to next message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1973
Registered: July 2009
Senior Member
That is an error message from the compiler. It does not find the library for linking. In C:\MinGW -LC:\librariesC\CImg149 there must be a file called CImg.dll

Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: mingw32/bin/ld.exe: cannot find -lCImg [message #844011 is a reply to message #840074] Fri, 13 April 2012 15:42 Go to previous message
Henning Riedel is currently offline Henning RiedelFriend
Messages: 310
Registered: July 2009
Senior Member
Hi,

If you need external headers, you need to specify the path to where the
headers can be found:
-I<path_to_includes>

If you need external libraries, you need to specify the path to where
the libraries can be found:
-L<path_to_libraries>
and, you need to specify the library using:
-l<name_of_lib>

The library should have a name like
lib<name_of_lib>.a (or .dll) in order for the -l<name_of_lib> switch to
work, otherwise, if the lib has a name like xxx.a you need to specifiy
it without the -l switch, by adding it with fullpath then.

In CDT, you can add them either in your project settings to the page
"Paths and Symbols" -> "Includes", (-I )
"Paths and Symbols" -> "Libraries", (-l )
"Paths and Symbols" -> "Library Paths". (-L )
and they will be added to the compiler/linker settings automatically
with the proper switches (as stated above in parentheses)

Am 09.04.2012 18:27, schrieb Daniela Ramsauer:
> I am trying to include an image library to eclipse... but just get
> following error message:
> g++ -LC:\MinGW -LC:\librariesC\CImg149 -oCImgSd.exe CImgSd.o -lCImg
> c:/mingw/bin/../lib/gcc/mingw32/4.6.1/../../../../mingw32/bin/ld.exe:
> cannot find -lCImg
>
> I already added the library search paths, where the 1. MinGw and 2. CImg
> files are, in Project properties - C/C++Build - Settings
>
> First in GCC C++ Compiler - includes
> second in GCC C Compiler - includes
> third in MinGW C++ Linker - libraries
>
> Furthermore I added the name of of the lib file 'CImg' to the second and
> third.
>
> The file it should find is 'CImg.h' and it is placed in the C:\MinGW
> -LC:\librariesC\CImg149 folder.
>
> Someone knows what's wrong, because I'm googling for three days right
> now and tried many things but nothing worked out...
>
> Or is it maybe a mingw problem, someone knows a better C++ Compiler,
> which I can use easily with an image processing library?
>
>
Previous Topic:Beginner Help
Next Topic:[SOLVED] Ubuntu 11.10 upgrade + upgrade Galileo to Eclipse Indigo - now linking fails
Goto Forum:
  


Current Time: Tue Mar 19 02:00:46 GMT 2024

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

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

Back to the top