Xcode 10 ld: library not found for -lstdc++.6

更新Xcode以后,也许会发现原本运行得美滋滋的工程报错了💔。。。
有可能会遇到以下报错


报错类型.png

这是因为,Xcode10废弃了libstdc++,相关的库文件
libstdc++.6.0.9.dylib
libstdc++.6.dylib
libstdc++.dylib
libstdc++.6.0.9.tbd
libstdc++.6.tbd
libstdc++.tbd
也从Xcode10中删除了。

官方推荐解决方法当然是尽快转到libc++开发😋。

但是如果还想要继续在Xcode10上编译依赖libstdc++的项目或库,可以通过把Xcode9中的libstdc++相关库文件复制到Xcode10中即可。

步骤一

步骤一.png

步骤二
步骤二.png

步骤三

有可能升级以后,没有了Xcode9的文件,这里将需要的文件贴出来,对应文件夹复制进去即可。
https://github.com/viawei/libstdc-

1、路径1:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/
将文件复制进此目录后,真机可正常运行

若需要模拟器也可正常运行,需进行:
2、路径2:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/
3、路径3:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/

复制完成,清理一下:comman + shift + k,运行,搞定~✿✿ヽ(°▽°)ノ✿☀️


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