【问题标题】:Is adMob's -ObjC linker flag necessary?adMob 的 -ObjC 链接器标志是否必要?
【发布时间】:2014-10-18 08:18:02
【问题描述】:

我问的原因是没有标志它可以很好地构建。
但是如果我确实添加了标志,它会引发一堆错误:

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

【问题讨论】:

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


    【解决方案1】:

    检查您的目标->构建阶段-> 将二进制文件与实验室链接是添加所有必需的框架

    【讨论】:

      【解决方案2】:

      您还需要链接:

      Social.framework
      Accounts.framework
      

      转到项目Build Phases->Link Binary with Libraries 并添加它们。如果您已经拥有它们,请尝试将它们删除并重新添加。

      我遇到了这个问题,我添加了这些并已修复。

      在这里找到它Parse Starter Project LogIn and Register View Controllers Errors

      【讨论】:

        猜你喜欢
        • 2011-10-01
        • 1970-01-01
        • 2015-08-07
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2013-07-29
        • 1970-01-01
        相关资源
        最近更新 更多