在Xcode9上正常编译的项目,升级到Xcode10, 编译编译找不到库问题 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中删除了。
方法一:
最好的解决办法还是尽快转到libc++开发,如联系第三方框架开发者, 剔除更换掉libstdc++相关的依赖库
方法二:
在xcode10中,添加被移除的libstdc++的项目或库.
A.下载libstdc++文件包,解压 点我下载 libstdc++文件包
B.打开mac电脑终端, 拷贝以下代码段,
C.把解压包1,2.3,4文件夹里的文件,拷贝入以下对应1,2,3,4路径里.
路径1
open /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/
路径2
open /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/
路径3
open /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/
路径4
open /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/