Xcode更新之后libstdc++库编译报错
2019-02-12 本文已影响12人
小木惊风
问题原因
xcode 10 移除了 libstdc++ 库, 替换为 libc++ 库而导致无法找到头文件。
报错信息
![](https://img.haomeiwen.com/i9618854/ca144b5c99b7dbad.png)
解决方案
下载 libstdc++ 库
链接: https://pan.baidu.com/s/1-9Qkv3O7gGJPj--r-8CpPQ 提取码: zr1y
将文件夹中的文件分别对应复制到Xcode中的以下4个目录中即可:
- /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/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/
操作步骤: Finder -- 右键 -- 前往文件夹
![](https://img.haomeiwen.com/i9618854/4f392382b1cccc8b.png)
将编号对应的文件复制到对应编号的文件目录中即可。