c++ - Xcode 4.6/Clang 4.2 找不到 C++11 header

标签 c++ xcode c++11 clang std

我试图在 iOS 项目中包含一些 C++11 header ,但 Xcode/Clang 找不到它们。我正在尝试包括 <memory> , <functional>和其他一些人。但它提示说在构建过程中找不到它们(尽管我右键单击并“跳转到定义”加载文件......)。如何让我的项目使用 C++11 头文件?

Lexical or Preprocessor Issue 'memory' file not found
Lexical or Preprocessor Issue 'functional' file not found

我的项目设置是:

C++ Language Dialect = C++11 [-std=c++11]
C++ Standard Library = libc++ (LLVM C++ standard library with C++11 support)

尝试包含 header 的文件是 .h对于模板类和 .h包含在 .mm 中实现。

最佳答案

事实证明,Clang 的错误消息没有帮助:这些文件的根包含是一个 .m 文件,编译为 Objective-C,所以我将其重命名为 .mm,编译为 Objective-C++,然后开始工作。

关于c++ - Xcode 4.6/Clang 4.2 找不到 C++11 header ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14852369/

相关文章:

ios - ld : framework not found AudioUnit, ios9

c++ - 函数返回 int&

c++ - sizeof(T) == sizeof(int) 吗?

c++ - 如何计算整数中的零位数?

ios - Xcode 6 Beta7 NSDictionary 到 Swift

C++11 std::thread::detach 和访问共享数据

c++ - 如何在参数包不是最后一个参数的 C++ 中编写可变参数模板函数?

c++ - 如何在运行时使用 typeof 创建一个 void * 指针

c++ - 默认 move 构造函数和引用成员

ios - 应用程序在启动时崩溃