欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

iOS 下载最新版Xcode #include 报错 'string' file not found C++头文件缺失问题

程序员文章站 2022-05-29 08:28:42
...

下载最新版Xcode  #include <string>报错 'string' file not found C++头文件缺失问题

 

(如果pod项目在编译时会遇到: clang: warning: libstdc++ is deprecated; move to libc++ [-Wdeprecated] 时,也可用同种方案进行解决)

 

将对应文件拷贝到最新版XCode对应目录下

 

将cpp文件夹下的c++拷贝到Xcode对应目录下 (此种方式目前是适用于xcode 10以上的版本,在今天下午的xcode 13中运用该方法,也解决了该问题)

 

```

真机:

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

模拟器:    

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/include/c++

```

Xcode10中缺少的`libstdc++6.0.9.tbd`

其中文件夹 1、2、3、4 中的文件分别对应复制到Xcode10中的以下4个目录中即可:

```

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

 

2/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/

 

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

 

4/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/

```

Xcode11路径:

Xcode11文件1路径发生改变

```

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

```

 以下是该文件的腾讯微云下载路径:

链接:https://share.weiyun.com/r9XyO1HQ

密码:65wh45