2
我目前正在尝试使用Magick ++ API编译一个简单的C++代码。我正在编译的实际代码很简单。只是一个“hello world”,在顶部包含#include Magick ++。h。无法使用Magick ++编译代码(库问题)
问题是,编译器似乎无法找到-lMagick ++。请参阅下面
错误ImageMagick的是从安装二进制文件在Cygwin中通过Windows 7,我做了以下配置中安装
export MAGICK_HOME="$HOME/ImageMagick-6.8.8"
export PATH="$MAGICK_HOME/bin:$PATH"
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$MAGICK_HOME/lib"
export PKG_CONFIG_PATH="$MAGICK_HOME/lib/pkgconfig"
CPP文件后:
g++ `Magick++-config --cppflags` -o hello hello_world.cpp \ `Magick++-config --ldflags --libs`
:
#include <iostream>
#include <Magick++.h>
using namespace std;
int main(int argc, char ** argv)
{
InitializeMagick(*argv);
cout<<"Hello Magick++"<<endl;
return 0;
}
与编译
后退:
g++: -lMagick++: No such file or directory
cc1plus: warning: command line option "-fopenmp" is valid for D but not for C++
hello_world.cpp: In function `int main(int, char**)':
hello_world.cpp:7: error: `InitializeMagick' undeclared (first use this function)
hello_world.cpp:7: error: (Each undeclared identifier is reported only once for each function it appears in.)
请显示'Magick ++ - config --cppflags'和'Magick ++ - config --ldflags --libs'的输出 – iehrlich
'-fopenmp'从哪里来? –