构建登录演示时的链接器错误

Posted

技术标签:

【中文标题】构建登录演示时的链接器错误【英文标题】:Linker error when building Login Demo 【发布时间】:2015-10-01 17:46:02 【问题描述】:

当我尝试从 https://github.com/firebase/login-demo-ios 构建 iOS 登录演示时遇到此错误:

Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_Firebase", referenced from:
      objc-class-ref in ViewController.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

我已将项目 Podfile 更新为使用 Firebase 2.4.1,并将目标更新为 iOS 8.4,并且正在使用 XCode 7.0.1。我该如何解决这个问题?

【问题讨论】:

你可能想在 Github repo 上创建这个问题。 【参考方案1】:

根据@Frank van Puffelen 的建议,我在 Github 上创建了一个问题,并得到了回复 (https://github.com/firebase/login-demo-ios/issues/15):

这是由于 CocoaPods 上的 Firebase 版本出现问题。我们正在努力解决这个问题。在我们发布之前,作为一种解决方法,您可以在 Podfile 中指向 2.3.3。

我想这会破坏任何从 CocoaPods 中提取 Firebase 2.4 的项目。

【讨论】:

以上是关于构建登录演示时的链接器错误的主要内容,如果未能解决你的问题,请参考以下文章

使用 yaml-cpp 0.5 DLL 时的链接器错误

使用静态成员时的链接器错误

通过函数指针使用内部函数时的链接器错误

从头文件中定义方法时的c ++链接器错误[重复]

iOS Facebook 登录 - 链接器错误

使用 OpenSSL 构建 LibCurl 会导致链接器错误