Page 1 of 1

[solved] How to include Magick++ in Eclipse?

Posted: 2008-08-25T12:13:39-07:00
by reimer
Sorry for this "simple" question. The search function didn't work with the keywords 'eclipse' and 'library path', so that's why I'm posting now.

I included the header files from /usr/local/include/Magick++ and what libraries should I use?

There are:

/usr/local/lib/libMagick++.10.0.7.dylib
/usr/local/lib/libMagick++.10.dylib
/usr/local/lib/libMagick++.a
/usr/local/lib/libMagick++.dylib
/usr/local/lib/libMagick++.la

Re: How to include Magick++ in Eclipse?

Posted: 2008-08-26T06:54:58-07:00
by reimer
Ok, it's quite easy. I read the manpage several times but didn't understand how to use the options. But I found it out.

For newbies:
Lets say you would like to use a library named libMagick++.a . Then you have to tell the compiler the location (if it's a standard location this is optional) by -Ldir and tell him the named library -lMagick++ without the prefix lib and the suffix .a. Of course the compiler must know the location of the header files.

In Eclipse you can configure it by right clicking on your project and a click on "Properties". Under "C/C++ Build" -> "Settings" -> "Tool settings" you can configure your header file locations ("GCC C++ Compiler"->"Directories") and the library paths ("MacOS X C++ Linker" -> "Libraries" on my computer).