百度语音用法小结

这两天在使用百度语音,遇到一个很坑爹的问题,把静态库加入工程后,总是会出现错误,错误如下,

ld: warning: directory not found for option '-L/Users/nind/XcodeProjects/BaiduYuyinDemo/libBDVoiceRecognitionClient'

Undefined symbols for architecture armv7:

  "_CTRadioAccessTechnologyGPRS", referenced from:

      -[BDVRClientImp startVoiceRecognition:] in libBDVoiceRecognitionClient.a(BDVRClientImp.o)

  "_OBJC_CLASS_$_CTTelephonyNetworkInfo", referenced from:

      objc-class-ref in libBDVoiceRecognitionClient.a(BDVRClientImp.o)

ld: symbol(s) not found for architecture armv7

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


检查来检查去,做法完全根据开发文档来的,但是还是有错误,添加进入的静态库也是根据开发文档来的,找了很多原因都找不到,后来对比demo,才发现,原来还是少加入了一个依赖库,谷歌一下_OBJC_CLASS_$_CTTelephonyNetworkInfo,发现这个跟CoreTelephony.framework这个framework有关,加入依赖库后,再重新build,果然就可以了,百度影音开发文档很久没有更新了,真是坑爹啊。


你可能感兴趣的:(iOS开发)