Xcode10报错libstdc

2018/6/11

由于Xcode10 已经禁用libstdc++libstdc++.6libstdc++6.0.9这三个库的使用,所以老项目中有用到这三个库的,会编译出错。
我就遇到了这个问题,之前的项目引入的sdk依赖了libstdc++,所以当我升级到xcode10之后就编译不通过,于是在网上找到了解决方法。

解决方法

首先解压同级目录下的libstdc压缩包

1.真机

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

2.模拟器

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

3.Runtime

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

后面 xcode 12 runtime 位置换为了下面这个

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