Page 1 of 1

Missing Magick++ Methods, Image::type(...)

Posted: 2010-03-08T03:25:56-07:00
by Morris
Hello all,

I've not come across this problem on any forum so I decided to post.
I'm using the Image Magick library with the Magick++ interface for a c++ Image Classification project.
I'm working on Mac OSX 10.6.2, compiling in unix using a Makefile and the standard:
`Magick++-config --cppflags --cxxflags --ldflags --libs` to link to Magick++.
I use the ImageMagick distribution provided by macports.

I have no problem compiling and running code that calls the Magick++ library.

Code: Select all

Image image = new Image(pic.jpg);
image.wave();
image.write("wave_pic.jpg");
This works without fault, giving me the wavy version of the original picture.

However a problem occurs when I attempt to convert the image to grayscale like this:

Code: Select all

Image image = new Image(pic.jpg);
image.type(Magick::GrayscaleType);
image.write("gray_pic.jpg");
Compilation succeeds without errors or warnings, but when linking I'm confronted with this:

Code: Select all

Undefined symbols:
  "Magick::Image::type(MagickLib::ImageType)", referenced from:
      _main in main.o
ld: symbol(s) not found
The same happens when calling quantizeColorSpace(...) which I tested as it can also be used to convert to grayscale. I find this strange as I am able to call other methods belonging to the Image class without this problem.

It appears that the method Image::type(MagickLib::ImageType) that is declared in the header isn't present in my version of libMagick++ libMagickWand or libMagickCore.
Is this a known issue? Where should I look to fix it?

Thanks in advance for any insights.

- Morris

Re: Missing Magick++ Methods, Image::type(...)

Posted: 2010-03-08T05:29:38-07:00
by magick
Your code works for us under Linux. We're using ImageMagick 6.6.0-3, the current release. We're clueless why its failing for you.

Re: Missing Magick++ Methods, Image::type(...)

Posted: 2010-03-08T06:47:02-07:00
by Morris
I compiled and installed ImageMagick and it works now. (so problem solved I guess)

It appears this problem is unique to the Macports Distribution (6.5.9-0 ) of ImageMagick, at least in my case.
Would love to know if anyone else has experienced this.