在集成Nuance Dragon Mobile的语音识别功能时,出现了针对架构armv7的未定义符号。

9

我正在将我的应用程序与Nuance Dragon Mobile的语音技术集成,但在运行时出现以下错误:

Undefined symbols for architecture armv7:
  "_kCFStreamPropertySSLPeerCertificates", referenced from:
      l469 in SpeechKit(libSpeechKit.a-armv7-master.o)
      l642 in SpeechKit(libSpeechKit.a-armv7-master.o)
      l643 in SpeechKit(libSpeechKit.a-armv7-master.o)
  "_kCFStreamSSLValidatesCertificateChain", referenced from:
      l469 in SpeechKit(libSpeechKit.a-armv7-master.o)
  "_kCFStreamSSLAllowsAnyRoot", referenced from:
      l469 in SpeechKit(libSpeechKit.a-armv7-master.o)
  "_OBJC_CLASS_$_AVAudioPlayer", referenced from:
      objc-class-ref in SpeechKit(libSpeechKit.a-armv7-master.o)
  "_kCFStreamSSLPeerName", referenced from:
      l469 in SpeechKit(libSpeechKit.a-armv7-master.o)
  "_kCFStreamSSLAllowsExpiredRoots", referenced from:
      l469 in SpeechKit(libSpeechKit.a-armv7-master.o)
  "_kCFStreamSSLAllowsExpiredCertificates", referenced from:
      l469 in SpeechKit(libSpeechKit.a-armv7-master.o)
  "_SecCertificateCopySubjectSummary", referenced from:
      l642 in SpeechKit(libSpeechKit.a-armv7-master.o)
  "_SecCertificateCopyData", referenced from:
      l643 in SpeechKit(libSpeechKit.a-armv7-master.o)
  "_kCFStreamPropertySSLSettings", referenced from:
      l469 in SpeechKit(libSpeechKit.a-armv7-master.o)
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

请帮我解决这个错误。
2个回答

48
似乎您还没有将 CFNetwork.FrameworkSystemConfiguration.FrameworkSecurity.Framework 添加到您的项目中。在 Xcode 的“要链接的库”部分添加它们,一切都应该没问题。

10
@Huey 我是个魔术师 :) 简单来说, symbols not found 是一个链接错误,这意味着在编译各个源文件后,由于缺少函数,导致生成的目标文件无法组合成完整的可执行文件。这些函数在框架中。通过熟记最常见框架的前缀(核心基础框架 - CF,安全框架 - Sec等),很容易就能知道需要做什么。 - user529758
4
在安装 AFNetworking cocoapod 时遇到了构建问题,需要添加 Security.framework。很好的答案。 - David Faivre
非常感谢您解释框架前缀的问题;在解决问题的同时学到新知识总是很好的。:] - weienw

6

非常抱歉回复晚了,我已经自己解决了这个问题。

H2C03接近正确,但实际上你需要的是CFNetwork.Framework和Security.framework。

不幸的是,在Dragon文档中的“语音基础知识”教程中,只显示了需要UIKit.framework、Foundation.framework、CoreGraphics.framework、AudioToolbox.framework、SystemConfiguration.framework和SpeechKit.framework。这有点误导人。

如果你打开DragonMobileRecognizer示例项目,可以将它使用的框架与你的进行比较,看看你缺少了哪些。

DragonMobileRecognizer Sample Project Frameworks


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接