suchen

Heim  >  Fragen und Antworten  >  Hauptteil

objective-c - iOS编译失败ld: symbol(s) not found for architecture x86_64错误

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)

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

巴扎黑巴扎黑2771 Tage vor603

Antworte allen(1)Ich werde antworten

  • 高洛峰

    高洛峰2017-04-18 09:35:52

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

    Antwort
    0
  • StornierenAntwort