OpenFrameworks的Apple Mach-O链接器(Id)错误

时间:2015-11-12 21:02:21

标签: xcode libraries openni openframeworks

我在Mac OS X 10.11.1上使用XCode 7.1 我正在使用一个名为ofXopenNI的插件与openFrameworks,它基本上是openFrameworks的OpenNI接口。它有一些我安装并链接到我的XCode项目的要求。仍然有一个我无法解决的链接错误。这是(我粘贴图像,以便我不会错过任何东西):

enter image description here

问题是libXnFormats已经包含在我的项目中,但是这个问题出现了。这就是我认为它包含在项目中的方式:

enter image description here

(第二个)
我知道在SO上有很多Mach-O链接错误问题,但这似乎是具体的。有人知道解决这个问题吗?

以下是文本格式的错误消息(因为它被要求):

Ld bin/huReconDebug.app/Contents/MacOS/huReconDebug normal x86_64
    cd /Users/ranveer/BTP/openFrameworks/apps/myApps/mac-huRecon
    export MACOSX_DEPLOYMENT_TARGET=10.11
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -L/Users/ranveer/BTP/openFrameworks/apps/myApps/mac-huRecon/bin -F/Users/ranveer/BTP/openFrameworks/apps/myApps/mac-huRecon/bin -F/Users/ranveer/BTP/openFrameworks/apps/myApps/mac-huRecon/../../../libs/glut/lib/osx -filelist /Users/ranveer/Library/Developer/Xcode/DerivedData/huRecon-eiqxyontximqaegxzkvzzaxrfiqs/Build/Intermediates/huRecon.build/Debug/huRecon.build/Objects-normal/x86_64/huReconDebug.LinkFileList -mmacosx-version-min=10.11 -dead_strip ../../../libs/poco/lib/osx/PocoCrypto.a ../../../libs/poco/lib/osx/PocoData.a ../../../libs/poco/lib/osx/PocoDataODBC.a ../../../libs/poco/lib/osx/PocoDataSQLite.a ../../../libs/poco/lib/osx/PocoFoundation.a ../../../libs/poco/lib/osx/PocoNet.a ../../../libs/poco/lib/osx/PocoNetSSL.a ../../../libs/poco/lib/osx/PocoUtil.a ../../../libs/poco/lib/osx/PocoXML.a ../../../libs/poco/lib/osx/PocoZip.a ../../../libs/tess2/lib/osx/tess2.a ../../../libs/glew/lib/osx/glew.a ../../../libs/cairo/lib/osx/cairo-script-interpreter.a ../../../libs/cairo/lib/osx/cairo.a ../../../libs/cairo/lib/osx/pixman-1.a ../../../libs/fmodex/lib/osx/libfmodex.dylib ../../../libs/rtAudio/lib/osx/rtAudio.a ../../../libs/openssl/lib/osx/crypto.a ../../../libs/openssl/lib/osx/ssl.a ../../../libs/glfw/lib/osx/libglfw3.a ../../../libs/FreeImage/lib/osx/freeimage.a ../../../libs/freetype/lib/osx/freetype.a ../../../addons/ofxAssimpModelLoader/libs/assimp/lib/osx/assimp.a ../../../addons/ofxKinect/libs/libusb-1.0/lib/osx/usb-1.0.a ../../../addons/ofxOpenCv/libs/opencv/lib/osx/opencv.a -stdlib=libstdc++ -framework Accelerate /Users/ranveer/BTP/openFrameworks/apps/myApps/mac-huRecon/bin/data/lXnFormats.dylib -lXnFormats -framework QTKit -lXnDDK -framework GLUT -lusb-1.0.0 /Users/ranveer/BTP/openFrameworks/apps/myApps/mac-huRecon/bin/data/XnFormats.dylib /Users/ranveer/BTP/openFrameworks/libs/openFrameworksCompiled/lib/osx/openFrameworksDebug.a -framework AGL -lXnVNite_1_5_2 -lnimRecorder -framework ApplicationServices -lXnVCNITE_1_5_2 -framework AudioToolbox -framework CoreAudio -framework CoreFoundation -lnimCodecs -lXnVFeatures_1_5_2 -framework CoreServices -lXnCore -framework OpenGL -lOpenNI -framework QuickTime -lnimMockNodes -lXnDeviceSensorV2KM -framework AppKit -lXnDeviceFile -framework Cocoa -lXnVHandGenerator_1_5_2 -framework IOKit -framework CoreVideo -Xlinker -dependency_info -Xlinker /Users/ranveer/Library/Developer/Xcode/DerivedData/huRecon-eiqxyontximqaegxzkvzzaxrfiqs/Build/Intermediates/huRecon.build/Debug/huRecon.build/Objects-normal/x86_64/huReconDebug_dependency_info.dat -o /Users/ranveer/BTP/openFrameworks/apps/myApps/mac-huRecon/bin/huReconDebug.app/Contents/MacOS/huReconDebug

然后,

ld: library not found for -lXnFormats
clang: error: linker command failed with exit code 1 (use -v to see invocation)

2 个答案:

答案 0 :(得分:2)

我有一个类似的问题,我得到-lXnDDK链接器错误而不是-lXnFormats。我假设您通过在include插件目录下添加libofxOpenNI个文件夹来创建新组。另外,将lib文件夹复制到bin/data/openni

我只需将bin/data/openni/lib添加到构建设置中的库搜索路径。

enter image description here

我在MAC OS X 10.10.5上使用Xcode 7.0.1。

答案 1 :(得分:1)

将库重命名为XnFormats而不是libXnFormats。 我最近在Xcode上遇到了一个奇怪的问题,即使使用-l命令(应该是前缀lib)确实想要为自定义库工作。

这可能是Xcode错误。但是现在这应该让它适合你。