因?yàn)閄code10徹底廢棄了libstdc++相關(guān)的庫文件甸饱,所以在Xcode10以后的版本中還需要繼續(xù)使用,需要添加以下文件:
1.真機(jī)
將libstdc++.6.0.9.tbd文件拷貝到以下路徑:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib
2.模擬器
將libstdc++.6.0.9.tbd文件拷貝到以下路徑:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib
完成上述操作,真機(jī)可以運(yùn)行,但是模擬器還會報(bào)錯(cuò):
Reason:no suitable image found. Did find: /usr/lib/libstdc++.6.dylib : mach-o, but not builtforiOS simulator
====================模擬器還需添加以下文件=====================
將libstdc++.6.0.9.dylib,libstdc++.6.dylib碟摆,libstdc++.dylib文件拷貝到以下路徑:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib
文件獲取鏈接:https://pan.baidu.com/s/1evpM29cusH5KwWecwE1I8g 密碼:r445