Link to home
Start Free TrialLog in
Avatar of neoanderz
neoanderz

asked on

How do you use ImageMagick?

I have Windows XP and Visual C++ 6.0.  I downloaded ImageMagick, built the config program, ran it, and then built "VisualDynamicMT".  From the ImageMagick website, this sample program is given for resizing an image:

#include <Magick++.h>
#include <iostream>
using namespace std;
using namespace Magick;
int main(int argc,char **argv)
{
  // Construct the image object. Seperating image construction from the
  // the read operation ensures that a failure to read the image file
  // doesn't render the image object useless.
  Image image;
  try {
    // Read a file into image object
    image.read( "girl.gif" );

    // Crop the image to specified size (width, height, xOffset, yOffset)
    image.crop( Geometry(100,100, 100, 100) );

    // Write the image to a file
    image.write( "x.gif" );
  }
  catch( Exception &error_ )
    {
      cout << "Caught exception: " << error_.what() << endl;
      return 1;
    }
  return 0;
}

I compiled this with no errors (1 warning) but when I build it I get this:

--------------------Configuration: mytest - Win32 Debug--------------------
Linking...
mytest.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall Magick::Image::~Image(void)" (??1Image@Magick@@UAE@XZ)
mytest.obj : error LNK2001: unresolved external symbol "public: void __thiscall Magick::Image::write(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?write@Image@Magick@@QAEXABV?$basic_string@DU?$ch
ar_traits@D@std@@V?$allocator@D@2@@std@@@Z)
mytest.obj : error LNK2001: unresolved external symbol "public: __thiscall Magick::Geometry::~Geometry(void)" (??1Geometry@Magick@@QAE@XZ)
mytest.obj : error LNK2001: unresolved external symbol "public: void __thiscall Magick::Image::crop(class Magick::Geometry const &)" (?crop@Image@Magick@@QAEXABVGeometry@2@@Z)
mytest.obj : error LNK2001: unresolved external symbol "public: __thiscall Magick::Geometry::Geometry(unsigned int,unsigned int,unsigned int,unsigned int,bool,bool)" (??0Geometry@Magick@@QAE@IIII_N0@Z)
mytest.obj : error LNK2001: unresolved external symbol "public: void __thiscall Magick::Image::read(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?read@Image@Magick@@QAEXABV?$basic_string@DU?$char
_traits@D@std@@V?$allocator@D@2@@std@@@Z)
mytest.obj : error LNK2001: unresolved external symbol "public: __thiscall Magick::Image::Image(void)" (??0Image@Magick@@QAE@XZ)
Debug/mytest.exe : fatal error LNK1120: 7 unresolved externals
Error executing link.exe.

mytest.exe - 8 error(s), 0 warning(s)

I have no idea what any of this means.  What do I need to do in order to use ImageMagick?
ASKER CERTIFIED SOLUTION
Avatar of jkr
jkr
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial