1. 程式人生 > >使用cocoapods匯入第三方後 報錯_OBJC_CLASS_$_XXX

使用cocoapods匯入第三方後 報錯_OBJC_CLASS_$_XXX

我們手動匯入第三方庫的時候,感覺管理不是很方便,於是會選擇使用Cocoapods管理。現在記錄一下使用心得,當使用cocoapods匯入afnetworking或者其他框架的時候,發現呼叫的時候總是報錯。

"_OBJC_CLASS_$_SVProgressHUD", referenced from: objc-class-ref in XXXX.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)

在網上搜索了一堆的攻略,然而這並沒有什麼卵用。

經過不斷地搜尋終於在網上看到了和我有相同問題的文章,解決了這個問題。

他是通過這個發現解決方法的

用cocoapod更新框架的時候,發現終端的一段警告

[!] The `myQQ [Debug]` target overrides the `OTHER_LDFLAGS` build setting defined in `Pods/Target Support Files/Pods/Pods.debug.xcconfig'. This can lead to problems with the CocoaPods installation

- Use the `$(inherited)` flag, or

- Remove the build settings from the target.

這下有了思路了,原來之前手動匯入第三方庫的時候,修改了Other Linker Flags
這裡寫圖片描述

所以解決辦法就是:
按照提示,增加$(inherited)
這裡寫圖片描述

新增之後,問題終於解決