新版 Xcode运行之前的项目提示library not found for -lstdc++.6.0.9

更新Xcode后,部分项目依赖 libstdc++.6.0.9 的会在Xcode 10无法运行,比如之前集成过百度地图。

其原因是Xcode 10中将libstdc++.6.0.9库文件删除,原本功能迁移至其他库。

解决方案:

1、下载stdc++.6.0.9

https://github.com/canlanrensheng/libstdc-.6.0.9

2、下载后把真机运行库放在新装的Xcode目录下:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib

把模拟器运行库放在新装的Xcode目录下:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib

替换完成后在模拟器iOS10.0以上运行会出现一个错误:

Reason: no suitable image found.  Did find:    /usr/lib/libstdc++.6.dylib: mach-o, butnotbuiltforiOS simulator

3、把下载的libstdc++.6.dylib放在新版的Xcode目录下:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/

4、最后重启Xcode就OK了。

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

推荐阅读更多精彩内容