【问题标题】:c++ header file not found when compiling ios project in xcode在xcode中编译ios项目时找不到c++头文件
【发布时间】:2022-01-17 09:58:44
【问题描述】:

当我构建一个 iOS 项目时,我收到一个错误“'tuple' file not found”。似乎 xcode 并没有尝试寻找 c++ 头文件。

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

在vector_make.h中,包含元组:

#include <tuple>

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

#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 或更高版本为目标才能访问<tuple>

标签: c++ ios xcode objective-c++


【解决方案1】:

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

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-12-02
    • 2012-11-14
    • 1970-01-01
    • 2021-11-30
    • 2016-03-10
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多