我已按照http://damienh.org/2009/06/20/setting-up-mgtwitterengine-with-yajl-106-for-iphone-development/的指示嘗試獲取XTode中MGTwitterEngine編譯的副本。如何使用OAuthConsumer框架編譯MGTwitterEngine?
我將YAJL安裝爲框架,OAuthConsumer作爲項目中的框架。當我嘗試和建設項目中,我得到了以下錯誤:
Ld build/Debug-iphonesimulator/UFrame.app/UFrame normal i386
cd /Users/twhume/Documents/Projects/UFrame
setenv MACOSX_DEPLOYMENT_TARGET 10.6
setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2.sdk -L/Users/twhume/Documents/Projects/UFrame/build/Debug-iphonesimulator -L/Users/twhume/Documents/Projects/UFrame -F/Users/twhume/Documents/Projects/UFrame/build/Debug-iphonesimulator -F/Users/twhume/Documents/Projects/UFrame -F/Users/twhume/Documents/Projects/UFrame/../../../Desktop/tmp/obj-c/OAuthConsumer/build/Release -filelist /Users/twhume/Documents/Projects/UFrame/build/UFrame.build/Debug-iphonesimulator/UFrame.build/Objects-normal/i386/UFrame.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -framework Foundation -framework UIKit -framework CoreGraphics -framework YAJLiOS -lxml2 -framework OAuthConsumer -o /Users/twhume/Documents/Projects/UFrame/build/Debug-iphonesimulator/UFrame.app/UFrame
Undefined symbols:
"_OBJC_CLASS_$_OAConsumer", referenced from:
objc-class-ref-to-OAConsumer in MGTwitterEngine.o
"_OBJC_CLASS_$_OAToken", referenced from:
objc-class-ref-to-OAToken in MGTwitterEngine.o
"_OBJC_CLASS_$_OAMutableURLRequest", referenced from:
objc-class-ref-to-OAMutableURLRequest in MGTwitterEngine.o
"_OBJC_CLASS_$_OARequestParameter", referenced from:
objc-class-ref-to-OARequestParameter in MGTwitterEngine.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
我是比較新的Xcode的,但在我看來像一個鏈接錯誤:未被列入莫名其妙的OAuth庫。但我不確定這裏到底發生了什麼事情,並且用Google搜索回答沒有幫助。我懷疑這個問題可能是我對Xcode不熟悉,而不是其他任何東西。
我也試過從頭開始下載和構建OAuthConsumer框架,並且包括那個(而不是包括捆綁在MGTwitterEngine源代碼中的版本)。它沒有任何區別。我已經清理過,重建過了,等等。我還確保libxml2.dylib包含在我的項目目標下的「Link Binary With Libraries」組中。
關於如何解決這個問題的任何想法?
檢查是否合適.m文件是在「編譯來源」目標階段。 – Eimantas 2011-04-20 10:43:55