Magick++ with MSYS2

Magick++ is an object-oriented C++ interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick++.
Post Reply
jho
Posts: 2
Joined: 2017-07-14T15:54:26-07:00
Authentication code: 1151

Magick++ with MSYS2

Post 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();
}
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Magick++ with MSYS2

Post 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.)
snibgo's IM pages: im.snibgo.com
jho
Posts: 2
Joined: 2017-07-14T15:54:26-07:00
Authentication code: 1151

Re: Magick++ with MSYS2

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