1
我想使用下面的代码获取屏幕截图;ImageMagick没有这样的文件或目录
#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;
}
但是我收到以下错误消息,magick-的config.h是在指定的文件夹“magick/magick-config.h”的,我不明白是什么问题;
$ 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
任何帮助将不胜感激。
感谢
你安装了“imagemagick”包吗? – Deepika 2013-05-03 06:28:19
我对C语言不太了解,但是我认为你需要把你的头文件(MagickWand.h)放在/bin或程序运行的程序目录中 –
ajduke
2013-05-03 06:32:50
是的,ImageMagick是安装成功,它认识到许多其他头文件调用,但在这一个旅行,我不知道为什么? – Sean 2013-05-03 09:39:04