Sorry if this is not the correct place to ask such a question. I'm new here.
I've been working on this issue for almost... holy crap.. 11 hours?
I can't for the life of me get my MinGW32 version of g++ to recognize ImageMagick. I have downloaded the latest MinGW binary release from here: http://www.imagemagick.org/script/binary-releases.php
I am trying to simply compile this simple c++ program:
Code: Select all
#include "Magick++.h"
using namespace Magick;
int main(int argc, char** argv)
{
Image pic;
pic.read("a.bmp");
pic.crop(Geometry(100, 100, 100, 100));
pic.write("b.bmp");
return 0;
}
- g++ -Wall -O2 -std=gnu++11 -DMAGICKCORE_QUANTUM_DEPTH=16 -DMAGICKCORE_HDRI_ENABLE=0 -c main.cpp
- g++ -Wall -O2 -std=gnu++11 -DMAGICKCORE_QUANTUM_DEPTH=16 -DMAGICKCORE_HDRI_ENABLE=0 -o main main.cpp -L. -llibMagick++-6.Q16-1
Code: Select all
$ ls
Magick++ libMagickCore-6.Q16-1.dll main.cpp
Magick++.h libMagickWand-6.Q16-1.dll main.o
libMagick++-6.Q16-1.dll magick wand
Code: Select all
C:\Users\SorenRyge\AppData\Local\Temp\cctu0zXM.o:main.cpp:(.text.startup+0x49):
undefined reference to `Magick::Image::read(std::__cxx11::basic_string<char, std
::char_traits<char>, std::allocator<char> > const&)'
C:\Users\SorenRyge\AppData\Local\Temp\cctu0zXM.o:main.cpp:(.text.startup+0xd9):
undefined reference to `Magick::Image::write(std::__cxx11::basic_string<char, st
d::char_traits<char>, std::allocator<char> > const&)'
collect2.exe: error: ld returned 1 exit status
(I have tried to compile ImageMagick myself, but niether the compilation or installation works with MinGW32 in my experience)
Thanks in advance.