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

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
Morris

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

Post 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
Last edited by Morris on 2010-03-08T06:44:20-07:00, edited 1 time in total.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

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

Post 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.
Morris

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

Post 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.
Post Reply