操作系統:OSX10.14
XCode:10.1
熱更新插件:https://github.com/nordnet/cordova-hot-code-push
這個熱更新插件,在安卓下編譯,沒有問題,可以順利編譯,但是在最新版的XCode下編譯,卻出現錯誤了!
錯誤信息:ld: library not found for -lstdc++.6
錯誤截圖:
看錯誤提示,就是缺少“lstdc++.6”的庫,於是搜索解決方法,最終解決了!
解決方法:把缺少的庫放到對應目錄中。
庫下載地址:https://codeload.github.com/MonkeyHZT/libstdc-6.0.9/zip/master
下載完畢之后,解壓縮目錄,里面有4個文件夾,在OSX里的shell窗口中,分別執行下面四條命令,每次執行完一條命令,打開命令索引對應的文件夾,把里面文件拷貝到命令打開的文件夾中。
1,
open /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/
拷貝文件夾1的文件到這個命令打開的目錄中。
2,
open /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/
拷貝文件夾2的文件到這個命令打開的目錄中。
3,
open /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/
拷貝文件夾3的文件到這個命令打開的目錄中。
4,
open /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/
拷貝文件夾4的文件到這個命令打開的目錄中。
隨后打開XCode,打開熱更新工程,編譯吧,應該解決問題了!
libc++是啥?https://www.cnblogs.com/sunylat/p/9938303.html
參考: