问题描述
升级到xcode10,项目编译突然报错,提示:
library not found for -lstdc++.6.0.9 library not found for -lstdc++.6 library not found for -lstdc++
问题描述
出现上述问题的原因主要是xcode10彻底废弃了libstdc++,相关的库文件libstdc++.6.0.9.dylib、libstdc++.6.dylib、libstdc++.dylib、libstdc++.6.0.9.tbd、libstdc++.6.tbd、libstdc++.tbd也从Xcode10中删除了。
解决办法
1、复制旧的xcode版本的相关文件到xcode10目录
旧的xcode相关文件路径:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libstdc++.6.0.9.dylib
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/libstdc++.6.0.9.tbd
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/libstdc++.6.0.9.tbd
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/libstdc++.6.0.9.tbd
如果怕文件找不到,或者操作麻烦,也可以使用别人写好的脚本来操作,方便快捷。
https://github.com/devdawei/libstdc-
2、尽快将你的项目转移到libc++,实际上我试过直接用libc++的类库来替换依赖库也是可以直接运行的,具体情况要具体分析。
全部评论