xcode 10 libstdc++.6.0.9.tbd libstdc++.6.0.9.dylib 报错解决

升级Xcode10 后, 项目编译时可能会出现libstdc++.6.0.9系列的错。
原因:
苹果早在 Xcode 8中 就废弃了libstdc++, 给了开发者两年时间过渡, 如今在Xcode 10中已不再支持. 在Build Phases > Link Binary With Libraries 中已经搜不到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/

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容