dre1234 0 Newbie Poster

Hi,

I've just installed GraphicsMagick-1.3.7 under MinGW on Windows Vista OS. I'm trying to compile an exemplary piece of code included in the documentation using the C++ API (Magick++).

#include <string>
#include <iostream>
#include <Magick++.h>

using namespace std;
using namespace Magick;

int main(int /*argc*/,char **/*argv*/)
{
  try {
    // Create base image (white image of 300 by 200 pixels)
    Image image( Geometry(300,200), Color("white") );

    // Set draw options
    image.strokeColor("red"); // Outline color
    image.fillColor("green"); // Fill color
    image.strokeWidth(5);

    // Draw a circle
    image.draw( DrawableCircle(100,100, 50,100) );

    // Draw a rectangle
    image.draw( DrawableRectangle(200,200, 270,170) );

    // Display the result
    image.display( );
  }
  catch( exception &error_ )
    {
      cout << "Caught exception: " << error_.what() << endl;
      return 1;
    }

  return 0;
}

Those are the errors returned:

**** Build of configuration Debug for project GraphicsProj ****

**** Internal Builder is used for build ****
g++ -IC:\MinGW\include\lib -IC:\MinGW\GraphicsMagick-1.3.7\magick -IC:\MinGW\GraphicsMagick-1.3.7\Magick++\lib -IC:\MinGW\GraphicsMagick-1.3.7 -O0 -g3 -Wall -c -fmessage-length=0 -oGraphicsProj1.o ..\GraphicsProj1.cpp
g++ -LC:\MinGW\GraphicsMagick-1.3.7\Magick++\lib -LC:\MinGW\GraphicsMagick-1.3.7\magick\.libs -LC:\MinGW\GraphicsMagick-1.3.7\Magick++\lib\.libs -LC:\MinGW\GraphicsMagick-1.3.7\magick\.deps -LC:\MinGW\GraphicsMagick-1.3.7\Magick++\lib\.deps -LC:\MinGW\GraphicsMagick-1.3.7 -LC:\MinGW\GraphicsMagick-1.3.7\utilities -oGraphicsProj.exe GraphicsProj1.o
GraphicsProj1.o: In function `main':
C:/Users/dru/workspace/GraphicsProj/Debug/../GraphicsProj1.cpp:12: undefined reference to `Magick::Color::Color(char const*)'
C:/Users/dru/workspace/GraphicsProj/Debug/../GraphicsProj1.cpp:12: undefined reference to `Magick::Geometry::Geometry(unsigned int, unsigned int, unsigned int, unsigned int, bool, bool)'
C:/Users/dru/workspace/GraphicsProj/Debug/../GraphicsProj1.cpp:12: undefined reference to `Magick::Image::Image(Magick::Geometry const&, Magick::Color const&)'
C:/Users/dru/workspace/GraphicsProj/Debug/../GraphicsProj1.cpp:12: undefined reference to `Magick::Geometry::~Geometry()'
C:/Users/dru/workspace/GraphicsProj/Debug/../GraphicsProj1.cpp:12: undefined reference to `Magick::Geometry::~Geometry()'
C:/Users/dru/workspace/GraphicsProj/Debug/../GraphicsProj1.cpp:12: undefined reference to `Magick::Color::~Color()'
C:/Users/dru/workspace/GraphicsProj/Debug/../GraphicsProj1.cpp:12: undefined reference to `Magick::Color::~Color()'
C:/Users/dru/workspace/GraphicsProj/Debug/../GraphicsProj1.cpp:15: undefined reference to `Magick::Color::Color(char const*)'
C:/Users/dru/workspace/GraphicsProj/Debug/../GraphicsProj1.cpp:15: undefined reference to `Magick::Image::strokeColor(Magick::Color const&)'
C:/Users/dru/workspace/GraphicsProj/Debug/../GraphicsProj1.cpp:15: undefined reference to `Magick::Color::~Color()'
C:/Users/dru/workspace/GraphicsProj/Debug/../GraphicsProj1.cpp:15: undefined reference to `Magick::Color::~Color()'
C:/Users/dru/workspace/GraphicsProj/Debug/../GraphicsProj1.cpolor::~Color()'
C:/Users/dru/workspace/GraphicsProj/Debug/../GraphicsProj1.cpp:16: undefined reference to `Magick::Color::~Color()'
C:/Users/dru/workspace/GraphicsProj/Debug/../GraphicsProj1.cpp:17: undefined reference to `Magick::Image::strokeWidth(double)'
C:/Users/dru/workspace/GraphicsProj/Debug/../GraphicsProj1.cpp:20: undefined reference to `Magick::Drawable::Drawable(Magick::DrawableBase const&)'
C:/Users/dru/workspace/GraphicsProj/Debug/../GraphicsProj1.cpp:20: undefined reference to `Magick::Image::draw(Magick::Drawable const&)'
C:/Users/dru/workspace/GraphicsProj/Debug/../GraphicsProj1.cpp:20: undefined reference to `Magick::Drawable::~Drawable()'
C:/Users/dru/workspace/GraphicsProj/Debug/../GraphicsProj1.cpp:20: undefined reference to `Magick::Drawable::~Drawable()'
C:/Users/dru/workspace/GraphicsProj/Debug/../GraphicsProj1.cpp:20: undefined reference to `Magick::DrawableCircle::~DrawableCircle()'
C:/Users/dru/workspace/GraphicsProj/Debug/../GraphicsProj1.cpp:20: undefined reference to `Magick::DrawableCircle::~DrawableCircle()'
C:/Users/dru/workspace/GraphicsProj/Debug/../GraphicsProj1.cpp:23: undefined reference to `Magick::Drawable::Drawable(Magick::DrawableBase const&)'
C:/Users/dru/workspace/GraphicsProj/Debug/../GraphicsProj1.cpp:23: undefined reference to `Magick::Image::draw(Magick::Drawable const&)'
C:/Users/dru/workspace/GraphicsProj/Debug/../GraphicsProj1.cpp:23: undefined reference to `Magick::Drawable::~Drawable()'
C:/Users/dru/workspace/GraphicsProj/Debug/../GraphicsProj1.cpp:23: undefined reference to `Magick::Drawable::~Drawable()'
C:/Users/dru/workspace/GraphicsProj/Debug/../GraphicsProj1.cpp:23: undefined reference to `Magick::DrawableRectangle::~DrawableRectangle()'
C:/Users/dru/workspace/GraphicsProj/Debug/../GraphicsProj1.cpp:23: undefined reference to `Magick::DrawableRectangle::~DrawableRectangle()'
C:/Users/dru/workspace/GraphicsProj/Debug/../GraphicsProj1.cpp:26: undefined reference to `Magick::Image::display()'
C:/Users/dru/workspace/GraphicsProj/Debug/../GraphicsProj1.cpp:26: undefined reference to `Magick::Image::~Image()'
C:/Users/dru/workspace/GraphicsProj/Debug/../GraphicsProj1.cpp:26: undefined reference to `Magick::Image::~Image()'
GraphicsProj1.o: In function `ZN6Magick14DrawableCircleC1Edddd':
C:/MinGW/GraphicsMagick-1.3.7/Magick++/lib/Magick++/Drawable.h:(.text$_ZN6Magick17DrawableRectangleC1Edddd[Magick::DrawableRectangle::DrawableRectangle(double, double, double, double)]+0x16): undefined reference to `vtable for Magick::DrawableRectangle'
C:/MinGW/GraphicsMagick-1.3.7/Magick++/lib/Magick++/Drawable.h:(.text$_ZN6Magick12DrawableBaseC2Ev[Magick::DrawableBase::DrawableBase()]+0x16): undefined reference to `vtable for Magick::DrawableBase'
C:/MinGW/GraphicsMagick-1.3.7/Magick++/lib/Magick++/Drawable.h:(.text$_ZN6Magick14DrawableCircleC1Edddd[Magick::DrawableCircle::DrawableCircle(double, double, double, double)]+0x16): undefined reference to `vtable for Magick::DrawableCircle'
collect2: ld returned 1 exit status
Build error occurred, build is stopped
Time consumed: 2730 ms.


I'm probably missing something very simple here but I've been gradually adding paths/libraries in the Project Properties of Eclipse without success and seems I'm stuck here...

Any help greatly appreciated!