我已按照http://damienh.org/2009/06/20/setting-up-mgtwitterengine-with-yajl-106-for-iphone-development/中的说明尝试获取在 XCode 中编译的 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 库没有以某种方式包含在内。但是我不确定这里到底发生了什么,并且在谷歌上搜索答案并没有帮助。我怀疑这个问题可能是我对 Xcode 的不熟悉,而不是其他任何东西。
我还尝试从头开始下载和构建 OAuthConsumer 框架,并将其包括在内(而不是包括与 MGTwitterEngine 源代码捆绑在一起的版本)。它没有任何区别。我已经清理,重建,等等。我还确保 libxml2.dylib 包含在我的项目目标下的“Link Binary With Libraries”组中。
关于如何解决这个问题的任何想法?