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

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)

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

巴扎黑
巴扎黑

répondre à tous(1)
小葫芦

Le problème a été résolu. La solution est la suivante :
~/Library/Developer/Xcode/DerivedData, supprimez tout ce qui se trouve dans le dossier DerivedData, puis rouvrez le projet clean>build

.
Derniers téléchargements
Plus>
effets Web
Code source du site Web
Matériel du site Web
Modèle frontal