1

当我尝试将我的应用程序与 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
4

0 回答 0