升級Xcode10 后, 項目編譯時可能會出現(xiàn)libstdc++.6.0.9系列的錯灼伤。
原因:
蘋果早在 Xcode 8中 就廢棄了libstdc++, 給了開發(fā)者兩年時間過渡, 如今在Xcode 10中已不再支持. 在Build Phases > Link Binary With Libraries 中已經(jīng)搜不到libstdc++的庫了
解決
將缺少的庫加入xcode10的相應目錄兑宇。缺失的庫可以在老版xcode目錄中找
模擬器需要的tbd: libstdc++.6.0.9.tbd
路徑:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/
真機需要的tbd: libstdc++.6.0.9.tbd
路徑:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/
dylib : libstdc++.6.0.9.dylib (兩個,包括快捷方式)
路徑:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/
如果是xcode11以上版本路徑變成
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/