体系结构armv7的未定义符号?这个错误是什么意思? [英] Undefined symbols for architecture armv7? What does this error mean?

查看:69
本文介绍了体系结构armv7的未定义符号?这个错误是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚将所有CocoaAsyncSocket代码标记为非ARC代码,并给了我这3个错误:

I just marked all of my CocoaAsyncSocket code as non-ARC code, and it's given me these 3 errors:

Undefined symbols for architecture armv7:
  "_kCFStreamNetworkServiceTypeVoIP", referenced from:
      -[GCDAsyncSocket enableBackgroundingOnSocketWithCaveat:] in GCDAsyncSocket.o
  "_kCFStreamNetworkServiceType", referenced from:
      -[GCDAsyncSocket enableBackgroundingOnSocketWithCaveat:] in GCDAsyncSocket.o
  "_kCFStreamPropertySSLSettings", referenced from:
      -[GCDAsyncSocket maybeStartTLS] in GCDAsyncSocket.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

有人知道这意味着什么以及如何解决吗?

Does anybody know what this means and how to fix it?

推荐答案

这意味着您正在编译的某些代码正在引用常量"kCFStreamNetworkServiceTypeVoIP","kCFStreamNetworkServiceType"和"kCFStreamPropertySSLSettings",但是找不到这些常量当它尝试将您的代码与其使用的库链接时.

It means that some code you are compiling is referencing the constants "kCFStreamNetworkServiceTypeVoIP", "kCFStreamNetworkServiceType", and "kCFStreamPropertySSLSettings", but that those constants weren't found when it tried to link your code with the libraries it uses.

不幸的是,可能有很多原因:

Unfortunately there's a bunch of reasons this could be:

  • 您可能拼错了它们
  • 对于该体系结构,它们可能会被#ifdef淘汰
  • 您可能未链接正确的librar(y,ies)
  • 可以将它们标记为具有隐藏"可见性,以便只能在声明库中使用
  • 可能是其他原因

您可以使用'nm'来查找从库的二进制文件中导出的符号,并可以使用'otool -L'来检查您的二进制文件正在链接的库.

You can use 'nm' to poke at the exported symbols from the binary of a library, and 'otool -L' to check which libraries your binary is linking.

这篇关于体系结构armv7的未定义符号?这个错误是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆