2015-11-12 54 views
2

我在Mac OS X 10.11.1上使用XCode 7.1。
我正在使用一個名爲ofXopenNI的插件與openFrameworks,它基本上是openFrameworks的OpenNI接口。它有一些我安裝並鏈接到我的XCode項目的要求。仍然有一個鏈接錯誤,我無法修復。這是(我粘貼的圖像,這樣我就不會錯過任何東西):OpenFrameworks的Apple Mach-O鏈接器(Id)錯誤

enter image description here

的問題是,libXnFormats已經包含在我的項目,然而這個問題上來。這是我認爲它包含在項目:

enter image description here

(第二個)
我知道有很多的Mach-O連接上SO錯誤的問題,但是這似乎具體。任何人都知道解決這個問題?


下面是文本格式的錯誤信息(因爲它是問):

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) 
+0

我已經在osx 10.10.5上與Xcode 7有一些類似的鏈接問題(沒有升級到El Capitan)。因爲,我一直堅持使用OpenFrameworks的Xcode 6.4,直到事情變得更加穩定爲止 –

+0

所以,你的意思是說沒有解決方案? 你降級了嗎?還是你有多個安裝?我一直在Mac上進行編碼,並在Linux上編譯了幾個月,這真的很痛苦:/ – Ranveer

+0

Mach-O鏈接錯誤聽起來像libXnFormats(來自OpenNI)看起來並不是編譯你當前構建的體系結構如果你是32位的,你應該使用的OpenNI版本也應該是32位,而不是64位......理想情況下,你可以爲兩者(通用)構建OpenNI庫。我沒有降級Xcode,我安裝了Xcode 6.1,6.4和7.0,以防萬一 –

回答

2

我有一個類似的問題,我得到了-lXnDDK鏈接器錯誤,而不是-lXnFormats。我假設你通過在ofxOpenNI addon目錄下包含includelib文件夾來創建新組。另外,將lib文件夾複製到bin/data/openni

我只是將bin/data/openni/lib添加到生成設置中的庫搜索路徑。

enter image description here

我使用的MAC OS X 10.10.5 Xcode的7.0.1。

+0

啊!這工作。你是先生,是一個巫師:D – Ranveer

+0

你也有答案嗎? http://stackoverflow.com/questions/34606116/loading-oni-can-t-create-any-node-of-the-requested-type – Ranveer

1

庫重命名爲XnFormats,而不是libXnFormats。 最近我在Xcode上遇到了一個奇怪的問題,甚至在使用-l命令(應該以lib爲前綴)時也想要爲自定義庫工作。

這可能是一個Xcode錯誤。但是,這應該讓它現在適合你。

+0

所以你的意思是說,如果我去它的發現者的位置,重命名爲XnFormats並將其添加到我的XCode項目,它應該工作?它不:/ – Ranveer