objective-c - iOS编译失败ld: symbol(s) not found for architecture x86_64错误
巴扎黑
巴扎黑 2017-04-18 09:33:52
0
1
597

xcode环境:7.3.1
系统版本:10.11.6

项目中通过cocoapods添加下面几个库:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'

target ‘Zhuoyue’ do
pod 'AFNetworking'
pod 'MOBFoundation_IDFA'
pod 'SMSSDK'
pod 'SSKeychain'
pod 'IQKeyboardManager'

end

安装pod时,实际安装的库版本如下:

Using AFNetworking (3.1.0)
Using IQKeyboardManager (4.0.5)
Using MOBFoundation_IDFA (2.0.10)
Using SMSSDK (2.0.5)
Using SSKeychain (1.4.1)

然而编辑时报错:


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

奇怪的是,真机运行时没有问题,但是模拟器编译时就报错了,请问这个问题该如何解决?

巴扎黑
巴扎黑

全部回复(1)
小葫芦

问题已得到解决,解决方法如下:
~/Library/Developer/Xcode/DerivedData 关掉xcode,删掉DerivedData这个文件夹里的全部东西 然后重新打开项目clean>build

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板