[Preston] Re: Image Magick++ problem

Michael Bach mbach at uclan.ac.uk
Sun Apr 18 20:06:35 BST 2004


Hello,
I recently started introducing myself into ImageMagick, Magick++ to be
more precise. I installed ImageMagick (IM++ is a part of it) and made
sure it works by running some command line programs. This works fine. I
followed this little tutorial:
http://www-106.ibm.com/developerworks/library/l-graf/?ca=dnt-428

My next step was then to use the C++ API, ie writing my image processing
programs and using the Magick++ object functionality for image
manipulation.
I followed a simple example:

#include <Magick++.h>
using namespace std;
using namespace Magick;

int main(int argc, char **argv)
{

    Image imageX( "640x400" , "xc:white" )

    //Image

    //Drawable drawable

    //drawable.circle(100,100,150,150);
    //image.draw(drawable);

    //image.display( );

    return 0;
}

The compilation result is rather mysterious:

simple1.cpp: In function `int main(int, char**)':
simple1.cpp:20: error: parse error before `return'

It seems like that the "Image" data type is unknown to the compiler. The
compilation options are as such:

# c++ `Magick++-config --cxxflags --cppflags` -o simple1 simple1.cpp
`Magick++-config --ldflags --libs`

# Magick++-config --cxxflags --cppflags
-O2 -march=i486 -mcpu=i686
-I/usr/include -I/usr/include/freetype2 -I/usr/include/freetype2
-D_FILE_OFFSET_BITS=64 -D_REENTRANT -I/usr/X11R6/include
-I/usr/X11R6/include/X11 -I/usr/include/libxml2

#Magick++-config --ldflags --libs                                       
                 -L/usr/lib -L/usr/X11R6/lib -L/usr/lib -L/usr/lib
-L/usr/lib
-lMagick++ -lMagick -llcms -ltiff -lfreetype -ljpeg -lpng -lexif
-lwmflite -ldpstk -ldps -lXt -lXext -lSM -lICE -lX11 -lbz2 -lxml2 -lz
-lpthread -lm

I hope somebody can help me with this.

kind regards, Mike.




More information about the Preston mailing list