ld:找不到文件:-fobjc-arc clang:错误:链接器命令失败,退出代码为1(使用-v查看调用)错误?

时间:2015-01-02 05:37:55

标签: ios objective-c xcode linker

当我使用Parse和Facebook框架时,我得到了错误,

ld: warning: ignoring file /Users/netdroid-apple/Desktop/Viivox/Viivox2912/FacebookSDK.framework/FacebookSDK, missing required architecture x86_64 in file /Users/netdroid-apple/Desktop/Viivox/Viivox2912/FacebookSDK.framework/FacebookSDK (3 slices)

Undefined symbols for architecture x86_64:
  "_FBTokenInformationExpirationDateKey", referenced from:
      -[PFFacebookTokenCachingStrategy cacheTokenInformation:] in ParseFacebookUtils(PFFacebookTokenCachingStrategy.o)
      -[PFFacebookTokenCachingStrategy expirationDate] in ParseFacebookUtils(PFFacebookTokenCachingStrategy.o)
      -[PFFacebookTokenCachingStrategy setExpirationDate:] in ParseFacebookUtils(PFFacebookTokenCachingStrategy.o)
  "_FBTokenInformationTokenKey", referenced from:
      -[PFFacebookTokenCachingStrategy accessToken] in ParseFacebookUtils(PFFacebookTokenCachingStrategy.o)
      -[PFFacebookTokenCachingStrategy setAccessToken:] in ParseFacebookUtils(PFFacebookTokenCachingStrategy.o)
  "_FBTokenInformationUserFBIDKey", referenced from:
      -[PFFacebookTokenCachingStrategy facebookId] in ParseFacebookUtils(PFFacebookTokenCachingStrategy.o)
      -[PFFacebookTokenCachingStrategy setFacebookId:] in ParseFacebookUtils(PFFacebookTokenCachingStrategy.o)
  "_OBJC_CLASS_$_BFExecutor", referenced from:
      objc-class-ref in Parse(PFUser.o)
      objc-class-ref in Parse(Parse.o)
      objc-class-ref in Parse(PFCommandCache.o)
      objc-class-ref in Parse(PFPinningEventuallyQueue.o)
      objc-class-ref in Parse(PFEventuallyQueue.o)
      objc-class-ref in Parse(BFTask+Private.o)
      l_OBJC_$_CATEGORY_BFExecutor_$_Background in Parse(BFTask+Private.o)
      ...
  "_OBJC_CLASS_$_BFTask", referenced from:
      objc-class-ref in Parse(PFFile.o)
      objc-class-ref in Parse(PFUser.o)
      objc-class-ref in Parse(Parse.o)
      objc-class-ref in Parse(PFBlockRetryer.o)
      objc-class-ref in Parse(PFCommandCache.o)
      objc-class-ref in Parse(PFConfig.o)
      objc-class-ref in Parse(PFEventuallyPin.o)
      ...
  "_OBJC_CLASS_$_BFTaskCompletionSource", referenced from:
      objc-class-ref in ParseFacebookUtils(PFFacebookAuthenticationProvider.o)
      objc-class-ref in Parse(PFNetworkCommandRunner.o)
      objc-class-ref in Parse(PFObject.o)
      objc-class-ref in Parse(PFOfflineStore.o)
      objc-class-ref in Parse(PFTaskHTTPRequestOperation.o)
      objc-class-ref in Parse(PFEventuallyQueue.o)
      objc-class-ref in Parse(PFSQLiteDatabase.o)
      ...
  "_OBJC_CLASS_$_FBAppCall", referenced from:
      objc-class-ref in ParseFacebookUtils(PFFacebookAuthenticationProvider.o)
  "_OBJC_CLASS_$_FBRequest", referenced from:
      objc-class-ref in ParseFacebookUtils(PFFacebookAuthenticationProvider.o)
  "_OBJC_CLASS_$_FBRequestConnection", referenced from:
      objc-class-ref in UserLoginViewController.o
  "_OBJC_CLASS_$_FBSession", referenced from:
      objc-class-ref in ParseFacebookUtils(PFFacebookAuthenticationProvider.o)
  "_OBJC_CLASS_$_FBSessionTokenCachingStrategy", referenced from:
      _OBJC_CLASS_$_PFFacebookTokenCachingStrategy in ParseFacebookUtils(PFFacebookTokenCachingStrategy.o)
  "_OBJC_METACLASS_$_FBSessionTokenCachingStrategy", referenced from:
      _OBJC_METACLASS_$_PFFacebookTokenCachingStrategy in ParseFacebookUtils(PFFacebookTokenCachingStrategy.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

之后我使用Flag" -force_load"在其他链接器标志中并获得以下错误

ld: file not found: `-fobjc-arc`

clang: error: linker command failed with exit code 1 (use -v to see invocation)

我已经看到了很多关于stackoverflow的答案,但没有得到确切的解决方案。

2 个答案:

答案 0 :(得分:0)

您的Facebook框架不包含x86_64架构。为您打算使用的所有体系结构构建它。

您也传递了一个链接器标志,链接器将-fobjc-arc解释为文件名。

答案 1 :(得分:0)

有同样的错误,因为我忘记导入Bolts框架,一旦复制到项目并将import语句添加到头文件,它编译没问题。

此外,我没有检查'复制'将螺栓框架导入项目并将其从原始位置移开时。