參考libstdc
Xcode升級到10、11兰绣、12世分、、缀辩、編譯項目用到該庫后報錯
方法:
- 真機:進入目錄Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib臭埋,把里面的libstdc++.6.0.9.tbd拷貝到Xcode10的相同的目錄里踪央,然后右擊制作替身,命名為libstdc++.6.tbd瓢阴。clear然后重啟Xcode畅蹂。
具體路徑
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/
- 模擬器:類似,只是目錄不同荣恐,進入之前版本的目錄Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib液斜,把里面的libstdc++.6.0.9.dylib拷貝到Xcode10的相同的目錄里,然后右擊制作替身叠穆,命名為libstdc++.6.dylib少漆。clear然后重啟Xcode。
具體路徑
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/
資源鏈接: https://pan.baidu.com/s/1WqasWsANQCyN4kSzKrm7AQ 密碼: h69o
下面無需看做筆記
16年買的代碼運行不起來
運?時硼被,會給報錯 :#include <string> #include <vector> 這兩個找不到
這個主要參考Xcode9-cpp
主要操作
- 將cpp文件夾下的c++拷貝到Xcode10對應目錄下 記得區(qū)分模擬器和真機
1)真機
路徑
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include/
導入后的截圖
2)
路徑
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/include/
- 導入
libstdc++6.0.9.tbd
庫
需要放到4個目錄路徑 其中1 要區(qū)分Xcode版本 步驟3示损、4 和最頂?shù)牟襟E一樣
1)
Xcode10的路徑
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/
Xcode11、12的路徑
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/
資源鏈接2:鏈接: https://pan.baidu.com/s/1tbtQlJ1rmwtfnj5YhZhZhg 密碼: 3aok
--來自百度網(wǎng)盤超級會員V6的分享