我正在尝试在Xcode中使用imagemagick,我收到此错误:
Ld /Users/sarashafaei/Library/Developer/Xcode/DerivedData/test4-bwkmkpnssqhpxgfntgtgkmzrcskr/Build/Products/Debug/test4 normal x86_64
cd /Users/sarashafaei/Desktop/test/test4
setenv MACOSX_DEPLOYMENT_TARGET 10.7
/Developer/usr/bin/g++-4.2 -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.7.sdk -L/Users/sarashafaei/Library/Developer/Xcode/DerivedData/test4-bwkmkpnssqhpxgfntgtgkmzrcskr/Build/Products/Debug -L/usr/local/lib -L/usr/local/lib/ImageMagick -L/usr/local/lib/ImageMagick-6.7.2 -L/usr/local/lib/pkgconfig -L/usr/local/lib/ImageMagick/modules-Q16 -L/usr/local/lib/ImageMagick-6.7.2/modules-Q16 -L/usr/local/lib/ImageMagick/modules-Q16/coders -L/usr/local/lib/ImageMagick/modules-Q16/filters -L/usr/local/lib/ImageMagick-6.7.2/modules-Q16/coders -L/usr/local/lib/ImageMagick-6.7.2/modules-Q16/filters -F/Users/sarashafaei/Library/Developer/Xcode/DerivedData/test4-bwkmkpnssqhpxgfntgtgkmzrcskr/Build/Products/Debug -filelist /Users/sarashafaei/Library/Developer/Xcode/DerivedData/test4-bwkmkpnssqhpxgfntgtgkmzrcskr/Build/Intermediates/test4.build/Debug/test4.build/Objects-normal/x86_64/test4.LinkFileList -mmacosx-version-min=10.7 -o /Users/sarashafaei/Library/Developer/Xcode/DerivedData/test4-bwkmkpnssqhpxgfntgtgkmzrcskr/Build/Products/Debug/test4
Undefined symbols for architecture x86_64:
"Magick::InitializeMagick(char const*)", referenced from:
_main in main.o
"Magick::Image::Image(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)", referenced from:
_main in main.o
"Magick::Image::~Image()", referenced from:
_main in main.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
任何帮助都将不胜感激。
答案 0 :(得分:1)
即使你有一个漂亮而长的链接器行,我也找不到任何丢失的-lImageMagick
。您需要在链接器/编译器调用结束时添加此标志,以实际链接到Magick库。