[C++] 使用imagemagick的一些问题

只要#include <Magick++.h>就可以使用所有功能了。

但是你可能会遇到

./my_magick.cpp:10: error: 'ThreadResource' was not declared in this scope
./my_magick.cpp:10: error: 'SetMagickResourceLimit' was not declared in this scope

这是由于Magic++把所有的C风格API都包含到namespace MagicCore里面去了。

正确的写法是:MagickCore::SetMagickResourceLimit(MagickCore::ThreadResource, 1);


扩展的说,Magic++里面,所有东西都在各种namespace里面。如果你发现什么东西是not declared,基本上都是namespace的引用问题。


此记。


ps:做imagemagic的同学可以一起交流。


posted on 2012-02-16 16:59  如果蜗牛有爱情  阅读(220)  评论(0编辑  收藏  举报

导航