Page 1 of 1

Magick++ with MSYS2

Posted: 2017-07-14T16:05:19-07:00
by jho
Hi,
I have a really special question but maybe someone can help:

I am trying to use Magick++ with MSYS2 http://www.msys2.org/. "MSYS2 is a software distro and building platform for Windows"
I use the Qt Creator with Qt5 and mingw 64 bit.

I ran into a problem:
When I compile my simple code, I get no error message, but when I run my programm I get the error message that the delegates are missing. Or it cannot find the color.xml.

Do I miss an include e.g.? It seems to me that all the dlls and config files (color.xml) are not found by magick++. But within MSYS2 threre is a compiled and working exe for magick.exe or convert.exe.

Code: Select all

#include <QCoreApplication>
#include <ImageMagick-7/Magick++.h>

#include <iostream>
using namespace std;

int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);

    Magick::InitializeMagick(*argv);

    Magick::Image image;
    try
    {

        image.read( "untitled.png" );
        image.write( "x.jpg" );

        Magick::Image image2( "100x100", "white" );
        image2.pixelColor( 49, 49, "red" );
        image2.write( "red_pixel.png" );
    }

    catch( Magick::Exception &error_ )
    {
        cout << "Caught exception: " << error_.what() << endl;
    }


    return a.exec();
}

Re: Magick++ with MSYS2

Posted: 2017-07-14T17:00:44-07:00
by snibgo
I know nothing about MSYS2, Qt Creator or mingw.

With Cygwin tools, after compiling and linking a program, I need to move it to same directory as the corresponding convert.exe. If I don't, it can't find the XML files. (I suppose it looks in the wrong place.)

Re: Magick++ with MSYS2

Posted: 2017-07-15T11:08:29-07:00
by jho
Oh how embarassing...
I was trying and trying the whole day and I was wondering why it is not working. Normally it should work, when I run the application directly from the IDE.Only for deploying I need to copy every dll to my app path.

I copied the exe to the folder where convert.exe is located and now everything works.

Thanks a lot. :)