Magic++ crash

Magick++ is an object-oriented C++ interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick++.
Post Reply
Silver_Sparrow
Posts: 3
Joined: 2016-10-30T16:35:22-07:00
Authentication code: 1151

Magic++ crash

Post by Silver_Sparrow »

Hello. I am getting started with Magic++ and am having a problem getting a basic program to run. Here is the code.

Code: Select all

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

using namespace std;
using namespace Magick;

int main()
{
    Image hello_image;
    hello_image.read("/media/[myUserName]/Data/test.bmp");
    hello_image.display();
    return 0;
}
I am compiling with Code::Blocks GCC compiler running under Linux Mint, and have successfully gotten the program to compile; however, the program crashes when run giving the following error.

Code: Select all

ImageMagicTest: magick/semaphore.c:531: LockSemaphoreInfo: Assertion `semaphore_info != (SemaphoreInfo *) ((void *)0)' failed.
Aborted

Process returned 134 (0x86)   execution time : 0.006 s
Press ENTER to continue.
I haven't been able to figure out what is going on since googling Magic++ and the error will only give a handful of results, however, I have pinned the issue down to the line where I try to read in the image. I was confident with the code since it matches the examples given, but obviously something isn't working. Can anyone help me with this?

Thanks.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Magic++ crash

Post by snibgo »

I supposed you've built the IM system with the same compiler etc?

I think LockSemaphoreInfo is used only for multi-threading, so you might rebuild without multithreading.

I should also ask: what version of IM?
snibgo's IM pages: im.snibgo.com
Silver_Sparrow
Posts: 3
Joined: 2016-10-30T16:35:22-07:00
Authentication code: 1151

Re: Magic++ crash

Post by Silver_Sparrow »

I downloaded the API using apt-get and don't know the version number, but since this seems to be a problem resident to the build, I will try building my own without multi-threading.
Silver_Sparrow
Posts: 3
Joined: 2016-10-30T16:35:22-07:00
Authentication code: 1151

Re: Magic++ crash

Post by Silver_Sparrow »

Okay, I built from source this time, with the option --without-multithread specified when configuring. (please correct me if did this at the wrong time, I am not used to building from source that often) Anyway, I am using GraphicsMagick-1.3.25/Magick++ now. After making and installing, I changed my include statement to

Code: Select all

#include </home/[myUsername]/Programming/GraphicsMagick-1.3.25/Magick++/lib/Magick++.h>
However, when I compile, I get the same error when trying to run the program.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Magic++ crash

Post by fmw42 »

This is an Imagemagick forum. Imagemagick is not the same as GraphicsMagick. You should consult the GraphicsMagick forum when installing GraphicsMagick.

For Imagemagick IM 7 installs, see

http://www.imagemagick.org/script/insta ... e.php#unix
http://www.imagemagick.org/script/advan ... lation.php

and

http://www.imagemagick.org/script/binary-releases.php

For Imagemagick IM 6 versions, see

http://legacy.imagemagick.org/script/ad ... lation.php
http://legacy.imagemagick.org/script/ad ... lation.php

and

http://legacy.imagemagick.org/script/bi ... leases.php
Post Reply