关于Xcode10中libstdc报错问题的解决

遇到问题

因为iPhoneXS以及iphoneXS_MAX在没有使用LaunchImage时,仍以iphoneX的为主,对适配不会产生什么影响。c++

iPhoneX_R在10月19号开始预订,26号出货,所以适配新机型迫在眉睫。因为没有拿到新机型,只能使用模拟器进行适配浏览。app

使用Xcode10真机编译后,发现一直报错,报错内容以下:iphone

报错显示没有找到libstdc++.6.0.9这个库,所以准备去Link Binary With Libraries中添加,进入后发现系统并无提供该库.code

碰到这个系统性的问题后,去官方论坛了搜索了一番,发现官方提供了解决的方案。官方的意思是libstdc++ 已经标记为废弃有5年了,建议你们使用全面支持C++11的 libc++ 库orm

解决方法

  1. 真机cdn

    libstdc_iPhoneOS拷贝到/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/libblog

  2. 模拟器ip

    libstdc_iPhoneSimulator拷贝到/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/get

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

相关文章
相关标签/搜索