Compiling a C++ Library dependent on Magick++ in Windows
Posted: 2011-01-19T00:26:21-07:00
I have written a C++ library which I use for various parts of a project I've been working in on for a while. I am mostly (or almost exclusively) a Linux user but for the sake of others, I'm trying to compile this library on Windows. I've been trying to compile it using the GNU GCC on windows as provided by MinGW (+MinGW-make). I've tried working both through the Eclipse CDT on which this was developed, and compiling straight from command line.
I've added the ImageMagick/include path to the include path (-I) and it seems to find the functions and compile happily.
However, once it tries to link it does not seem to find the Magick++ functions in the libraries.
I did see that compiling on Windows requires initialization of the library in the following manner (http://www.imagemagick.org/Magick++/):
which would work if I had a main method, but since I'm trying to compile a library, I don't have a main method or argv passed to it.
I've added the ImageMagick path to the library path (-L)
It does not recognize -lMagick++ as it does on my Linux box, although I'm not surprised since usually you have to put the full dll name. So I've tried adding -lCORE_RL_Magick++_ -lCORE_RL_magick_ -lCORE_RL_wand_ -lX11 and it find the libraries (or at least stops complaining about not finding them) but can't link any of the functions resulting in tons of "undefined reference" errors.
I was wondering if any one could enlighten me about how to go about this problem...
I've added the ImageMagick/include path to the include path (-I) and it seems to find the functions and compile happily.
However, once it tries to link it does not seem to find the Magick++ functions in the libraries.
I did see that compiling on Windows requires initialization of the library in the following manner (http://www.imagemagick.org/Magick++/):
Code: Select all
int main( ssize_t /*argc*/, char ** argv)
{
InitializeMagick(*argv);
I've added the ImageMagick path to the library path (-L)
It does not recognize -lMagick++ as it does on my Linux box, although I'm not surprised since usually you have to put the full dll name. So I've tried adding -lCORE_RL_Magick++_ -lCORE_RL_magick_ -lCORE_RL_wand_ -lX11 and it find the libraries (or at least stops complaining about not finding them) but can't link any of the functions resulting in tons of "undefined reference" errors.
I was wondering if any one could enlighten me about how to go about this problem...