Sean
Sean

Reputation: 43

ImageMagick No such file or directory

I am trying to get a screen shot using the following code;

#include <stdio.h>
#include </wand/MagickWand.h>

int main(int argc, char **argv)
{
MagickWandGenesis();
MagickWand *wand = NULL;
wand = NewMagickWand();
MagickReadImage(wand,"x:root"); // <-- Invoke ImportImageCommand
MagickWriteImage(wand,"screen_shot.png");
if(wand)wand = DestroyMagickWand(wand);
MagickWandTerminus();
return 0;
}

however I am getting the following error message, magick-config.h is in the specified folder 'magick/magick-config.h' , I do not understand what the problem is;

$ make screenshot
cc screenshot.c -o screenshot
In file included from /wand/MagickWand.h:29:0,
from screenshot.c:2:
/magick/magick-config.h:29:3: warning: #warning "you should set MAGICKCORE_QUANTUM_DEPTH to sensible default set it to configure time default"
/magick/magick-config.h:30:3: warning: #warning "this is an obsolete behavior please fix your makefile"
/magick/magick-config.h:52:3: warning: #warning "you should set MAGICKCORE_HDRI_ENABLE to sensible default set it to configure time default"
/magick/magick-config.h:53:3: warning: #warning "this is an obsolete behavior please fix yours makefile"
In file included from /wand/MagickWand.h:70:0,
from screenshot.c:2:
/magick/MagickCore.h:29:36: fatal error: magick/magick-config.h: No such file or directory
compilation terminated.
<builtin>: recipe for target `screenshot' failed
make: *** [screenshot] Error 1

Any help would be much appreciated.

Thanks

Upvotes: 4

Views: 6844

Answers (2)

Dealazer
Dealazer

Reputation: 69

You might have installed too much?

Try to remove Image-magick-"Perl Module"

The Perl Module.

And then again try the process to install ImageMagick with PECL or your other way.

Often this problem is occurring because of installation made with make install on a platform.

Remove all other installations and just do the installation from pure sources if you already started doing that.

.deb and .rpm packages might be installed in different ways than making from source.

Upvotes: 0

hcac
hcac

Reputation: 11

Yes, Actually I had a problem like that and it was fixed when I installed the package libmagickcore-dev with following command:

sudo apt-get install libmagickcore-dev

through the Ubuntu Repositories. :-)

Also If it did not work, you try installing the package called "graphicsmagick-libmagick-dev-compat". AC;

Upvotes: 1

Related Questions