IOS編譯報錯:objc-class-ref in AppDelegate.o之解決方案

轉自:

http://www.xuebuyuan.com/2160769.html



xcode6.0升級到xcode6.1後,程序編譯報錯,錯誤如下:這是個很常見的錯誤,很多項目在更換xcode版本後,都會出現類似的問題。


Undefined symbols for architecture x86_64:

  "_OBJC_CLASS_$_QQApiInterface", referenced from:

      objc-class-ref in AppDelegate.o

  "_OBJC_CLASS_$_ShareSDK", referenced from:

      objc-class-ref in AppDelegate.o

      objc-class-ref in RecipeDetailViewController.o

      objc-class-ref in showViewController.o

      objc-class-ref in video_show.o

  "_OBJC_CLASS_$_TencentOAuth", referenced from:

      objc-class-ref in AppDelegate.o

  "_OBJC_CLASS_$_WXApi", referenced from:

      objc-class-ref in AppDelegate.o

  "_OBJC_CLASS_$_WeiboApi", referenced from:

      objc-class-ref in AppDelegate.o

  "_OBJC_CLASS_$_YXApi", referenced from:

      objc-class-ref in AppDelegate.o

ld: symbol(s) not found for architecture x86_64

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

解決方案:

Xcode升級到6.1.1 默認讓所有App都通過64位編譯器編譯。原來在Xcode6.0的時候默認的Architectures只有(arm7,armv7s),到6.1.1默認就帶上arm64的參數了。


1.把1.選中Targets—>Build Settings—>Architectures。

把build active architectures only 改爲 NO。

2. 把最下面的Valid Architectures中的arm64參數刪掉就可以了

   或者:

雙擊Architectures,選擇other,刪除$(ARCH_STANDARD),然後增加armv7和armv7s(寫上:$(ARCHS_STANDARD_32_BIT))。

3.clean 再build。

結果設置如下圖:


目前設置完成後,問題順利解決


發佈了8 篇原創文章 · 獲贊 3 · 訪問量 5萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章