在 xcode 中编译 ios 项目时找不到 c++ 头文件

c++ header file not found when compiling ios project in xcode

当我构建一个 iOS 项目时,出现错误“找不到 'tuple' 文件”。似乎 xcode 没有试图寻找 C++ 头文件。

错误信息是: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.0.sdk/usr/include/simd/vector_make.h:5310:10: 'tuple' 找不到文件

在vector_make.h中包含元组:

#include <tuple>

这源自 AVFoundation.h 包含在 c++ 文件“tdav_apple.mm”中:

#if TDAV_UNDER_APPLE
#if TDAV_UNDER_IPHONE || TDAV_UNDER_IPHONE_SIMULATOR
#import <UIKit/UIKit.h>
#import <AudioToolbox/AudioToolbox.h>
#import <AVFoundation/AVFoundation.h>
#endif

我该如何解决?感谢您的帮助!

我会检查并确保您的语言版本至少为 C++11,因为那是引入元组的时间。

我未能验证 .mm 文件在项目文件中被正确标记为 C++(select 文件,然后打开右侧的“文件检查器”。)