I've googled my problem and found many pages, but none of them have exactly the same flavour and I can't get my problem to go away.
I have a program which uses Magick++ and works fine on my PC, but it fails on another computer where I'm trying to run the code. A minimal example is this:
Code: Select all
#include <iostream>
#include <Magick++.h>
int main(){
Magick::Image im;
im.read( "/fullpathtoimage.jpg" );
std::cout<< im.columns() <<"\n";
return 0;
}
This raises an exception:
Code: Select all
terminate called after throwing an instance of 'Magick::ErrorMissingDelegate'
what(): ImageMagick: NoDecodeDelegateForThisImageFormat `/fullpathtoimage.jpg' @ constitute.c/ReadImage/503
Aborted
Code: Select all
./convert /fullpathtoimage.jpg temp.png
Code: Select all
./identify -list configure
Code: Select all
DELEGATES bzlib mpeg fontconfig freetype jng jpeg pango png ps x xml zlib
LIBS -lfreetype -ljpeg -lpng12 -lfontconfig -lXext -lXt -lSM -lICE -lX11 -lbz2 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lxml2 -lz -lm
Code: Select all
./identify -list format | grep JPEG
Code: Select all
JNG* rw- JPEG Network Graphics
JPEG* rw- Joint Photographic Experts Group JFIF format (62)
PJPEG* rw- Joint Photographic Experts Group JFIF format (62)
The version I installed is ImageMagick-6.8.7-8, I built it from sources as I don't have root access at the machine, and I installed it to a location within my home (using ./configure --prefix=/home/... ). I checked if maybe there's an issue with linking my program against wrong ImageMagick (as there is an older system one too), but ldd reveals all is fine i.e. the program is linked against the one I installed, as I wanted, and running ldd on convert shows it is linked against exactly the same libraries. Also, ldd shows that my program is indeed linked against libjpeg.so.62 .