当我尝试将我的应用程序与ImageMagick ++链接时,我收到此错误。
Undefined symbols for architecture x86_64:
"Magick::Image::read(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
...
我正在使用最新的OSX SDK(10.8)...并编译为x86_64
我的图书馆是这样编译的:
./configure --disable-osx-universal-binary --without-perl --enable-shared --disable-static --without-pango --with-magick-plus-plus --with-quantum-depth=8
我将库添加到链接器,但它忽略了“-lMagick ++ - Q8”
我使用“lipo -info”来仔细检查结构,它与x86_64相匹配......那还有什么呢?
这是完整的链接器命令:
Ld /Users/MyUser/Library/Developer/Xcode/DerivedData/MyProject-cxtelbltlfqoftfcngpqxhiczxqs/Build/Products/Debug/libMyLib1.dylib normal x86_64
cd /Users/MyUser/Desktop/AllProject/Project1/MyLib1
setenv MACOSX_DEPLOYMENT_TARGET 10.8
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch x86_64 -dynamiclib -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -L/Users/MyUser/Library/Developer/Xcode/DerivedData/MyProject-cxtelbltlfqoftfcngpqxhiczxqs/Build/Products/Debug -L/usr/local/lib -L/opt/local/lib -L/Users/MyUser/Desktop/AllProject/Project1/MyLib1/../../../../Library/Developer/Xcode/DerivedData/MyProject-cxtelbltlfqoftfcngpqxhiczxqs/Build/Products/Debug -L/usr/local/Cellar/glfw/2.7.7/lib -L/usr/local/Cellar/glew/1.9.0/lib -L/usr/local/Cellar/freetype/2.4.11/lib -L/usr/local/Cellar/imagemagick/6.8.4/lib -L/usr/local/Cellar/jpeg/8d/lib -L/usr/local/Cellar/libpng/1.5.14/lib -L/usr/local/Cellar/libtool/2.4.2/lib -F/Users/MyUser/Library/Developer/Xcode/DerivedData/MyProject-cxtelbltlfqoftfcngpqxhiczxqs/Build/Products/Debug -filelist /Users/MyUser/Library/Developer/Xcode/DerivedData/MyProject-cxtelbltlfqoftfcngpqxhiczxqs/Build/Intermediates/MyLib1.build/Debug/MyLib1.build/Objects-normal/x86_64/MyLib1.LinkFileList -install_name /usr/local/lib/libMyLib1.dylib -mmacosx-version-min=10.8 -stdlib=libc++ -lstdc++ -liconv -lbz2 -lz -framework OpenGL -llib_json -lSFTools -lavcodec -lavdevice -lavfilter -lavformat -lavutil -lpostproc -lGLEW.1.9 -lGLEW -lx264 -lGLEWmx.1.9 -lGLEWmx -lglfw -lpng15 -lpng15 -lfreetype -lfreetype -lltdl -ljpeg -lltdl -lMagick++-6.Q8 -lMagickCore-6.Q8 -lMagickWand-6.Q8 -lglfw -lswresample -lswscale -single_module -compatibility_version 1 -current_version 1 -o /Users/MyUser/Library/Developer/Xcode/DerivedData/MyProject-cxtelbltlfqoftfcngpqxhiczxqs/Build/Products/Debug/libMyLib1.dylib