iOS-library not found for -lstdc++.6 / -lstdc++,#include

参考libstdc

Xcode升级到10、11、12、、、编译项目用到该库后报错

image

image

方法:

  • 真机:进入目录Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib,把里面的libstdc++.6.0.9.tbd拷贝到Xcode10的相同的目录里,然后右击制作替身,命名为libstdc++.6.tbd。clear然后重启Xcode。

具体路径

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/
  • 模拟器:类似,只是目录不同,进入之前版本的目录Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib,把里面的libstdc++.6.0.9.dylib拷贝到Xcode10的相同的目录里,然后右击制作替身,命名为libstdc++.6.dylib。clear然后重启Xcode。
    具体路径
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/

资源链接: https://pan.baidu.com/s/1WqasWsANQCyN4kSzKrm7AQ 密码: h69o

下面无需看做笔记

16年买的代码运行不起来

运⾏时,会给报错 :#include #include 这两个找不到
这个主要参考Xcode9-cpp

image

主要操作

  • 将cpp文件夹下的c++拷贝到Xcode10对应目录下 记得区分模拟器和真机

1)真机


image

路径

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include/

导入后的截图


image

2)


image

路径
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/include/
  • 导入libstdc++6.0.9.tbd
    需要放到4个目录路径 其中1 要区分Xcode版本 步骤3、4 和最顶的步骤一样
    image

    1)
    Xcode10的路径
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/

Xcode11、12的路径

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

资源链接2:链接: https://pan.baidu.com/s/1tbtQlJ1rmwtfnj5YhZhZhg 密码: 3aok
--来自百度网盘超级会员V6的分享

你可能感兴趣的:(iOS-library not found for -lstdc++.6 / -lstdc++,#include )