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'從哪裏來? –