adMob的-ObjC链接器标志是否必要?

时间:2014-08-25 08:05:52

标签: ios objective-c admob linker-errors linker-flags

我问的原因是它在没有旗帜的情况下建立得很好 但是,如果我添加标志,它会引发一堆错误:

Undefined symbols for architecture x86_64:
  "_ACAccountTypeIdentifierTwitter", referenced from:
      -[PF_Twitter getLocalTwitterAccountAsync] in Parse(PF_Twitter.o)
  "_FBTokenInformationExpirationDateKey", referenced from:
      -[PFFacebookTokenCachingStrategy cacheTokenInformation:] in Parse(PFFacebookTokenCachingStrategy.o)
      -[PFFacebookTokenCachingStrategy expirationDate] in Parse(PFFacebookTokenCachingStrategy.o)
      -[PFFacebookTokenCachingStrategy setExpirationDate:] in Parse(PFFacebookTokenCachingStrategy.o)
  "_FBTokenInformationTokenKey", referenced from:
      -[PFFacebookTokenCachingStrategy accessToken] in Parse(PFFacebookTokenCachingStrategy.o)
      -[PFFacebookTokenCachingStrategy setAccessToken:] in Parse(PFFacebookTokenCachingStrategy.o)
  "_FBTokenInformationUserFBIDKey", referenced from:
      -[PFFacebookTokenCachingStrategy facebookId] in Parse(PFFacebookTokenCachingStrategy.o)
      -[PFFacebookTokenCachingStrategy setFacebookId:] in Parse(PFFacebookTokenCachingStrategy.o)
  "_OBJC_CLASS_$_ACAccountStore", referenced from:
      objc-class-ref in Parse(PF_Twitter.o)
  "_OBJC_CLASS_$_FBAppCall", referenced from:
      objc-class-ref in Parse(PFFacebookAuthenticationProvider.o)
  "_OBJC_CLASS_$_FBRequest", referenced from:
      objc-class-ref in Parse(PFFacebookAuthenticationProvider.o)
  "_OBJC_CLASS_$_FBSession", referenced from:
      objc-class-ref in Parse(PFFacebookAuthenticationProvider.o)
  "_OBJC_CLASS_$_FBSessionTokenCachingStrategy", referenced from:
      _OBJC_CLASS_$_PFFacebookTokenCachingStrategy in Parse(PFFacebookTokenCachingStrategy.o)
  "_OBJC_CLASS_$_SLComposeViewController", referenced from:
      objc-class-ref in Parse(PF_Twitter.o)
  "_OBJC_CLASS_$_SLRequest", referenced from:
      objc-class-ref in Parse(PF_Twitter.o)
  "_OBJC_METACLASS_$_FBSessionTokenCachingStrategy", referenced from:
      _OBJC_METACLASS_$_PFFacebookTokenCachingStrategy in Parse(PFFacebookTokenCachingStrategy.o)
  "_SLServiceTypeTwitter", referenced from:
      -[PF_Twitter getAccessTokenForReverseAuthAsync:localTwitterAccount:] in Parse(PF_Twitter.o)
      -[PF_Twitter getLocalTwitterAccountAsync] in Parse(PF_Twitter.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
显然是来自Parse SDK的

然而,自their guide中所述,我想知道是否可以省略它。

我确实看到其他人遇到此问题,some saying -force_load会解决此问题,但我不确定-ObjC-force_load到底是做什么的,所以我不知道如何使用它。

怀疑我是否遗漏了任何框架,因为它没有标志就构建好了?

更新

我找到了如何使用-force_load here。但是,如果有人可以帮助解释-ObjC-force_load标志的内容,我们仍会感激不尽。

要使用的链接器标志应为-force_load libGoogleAdMobAds.a而不是-ObjC

2 个答案:

答案 0 :(得分:0)

签入您的目标 - >构建阶段 - > Link Binary With Libraries是添加的所有必需框架

答案 1 :(得分:0)

您还需要链接:

Social.framework
Accounts.framework

转到项目构建阶段 - >链接二进制文件库并添加它们。如果您已经拥有它们,请尝试将其删除并重新添加。

我有这个问题,我添加了这些,它已修复。

Parse Starter Project LogIn and Register View Controllers Errors

找到它