新版 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/

6828358-e33d14980822a5b4.png

4、最后重启Xcode就OK了。

猜你喜欢

转载自blog.csdn.net/weixin_33724059/article/details/87174021