可可触摸 – 具有XCode 4.2链接器错误的Facebook iOS SDK 3.1

我刚刚将我的项目中的Facebook iOS SDK更新为3.0到3.1。该项目不再编译。相反,我得到以下链接器错误:

Undefined symbols for architecture i386:
  "_ACFacebookAppIdKey", referenced from:
      -[FBSession authorizeUsingSystemAccountStore:accountType:permissions:defaultAudience:isReauthorize:] in FacebookSDK(FBSession.o)
  "_ACFacebookAudienceEveryone", referenced from:
      -[FBSession authorizeUsingSystemAccountStore:accountType:permissions:defaultAudience:isReauthorize:] in FacebookSDK(FBSession.o)
  "_ACFacebookAudienceFriends", referenced from:
      -[FBSession authorizeUsingSystemAccountStore:accountType:permissions:defaultAudience:isReauthorize:] in FacebookSDK(FBSession.o)
  "_ACFacebookAudienceKey", referenced from:
      -[FBSession authorizeUsingSystemAccountStore:accountType:permissions:defaultAudience:isReauthorize:] in FacebookSDK(FBSession.o)
  "_ACFacebookAudienceOnlyMe", referenced from:
      -[FBSession authorizeUsingSystemAccountStore:accountType:permissions:defaultAudience:isReauthorize:] in FacebookSDK(FBSession.o)
  "_ACFacebookPermissionsKey", referenced from:
      -[FBSession authorizeUsingSystemAccountStore:accountType:permissions:defaultAudience:isReauthorize:] in FacebookSDK(FBSession.o)
  "_OBJC_CLASS_$_ASIdentifierManager", referenced from:
      objc-class-ref in FacebookSDK(FBSettings.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Facebook docs清楚地说:

The SDK relies on three other frameworks (AdSupport, Accounts and
Social) to use the Facebook features built into iOS6.

Xcode 4.2中不存在这些框架。是否有任何解决方法,即我可以下载(在哪里?)和手动添加框架到我的项目,这将足以摆脱编译错误,或者我必须升级到Xcode 4.5?

这些框架是iOS 6的一部分(除了来自iOS 5的帐户之外)。如果您不升级到Xcode 4.5,而不是iOS 6 SDK,则无法使用它们。

您仍然可以将部署目标设置为iOS 4.3,如果这是您的问题。

我认为你的选择是:

>升级到Xcode 4.5或
>使用Facebook SDK 3.0。

翻译自:https://stackoverflow.com/questions/12598209/facebook-ios-sdk-3-1-with-xcode-4-2-linker-errors

转载注明原文:可可触摸 – 具有XCode 4.2链接器错误的Facebook iOS SDK 3.1