I'm trying to include some C++11 headers in an iOS project, but Xcode / Clang can't find them. I'm trying to include <memory>
, <functional>
and a few others. But it complains that it can't find them during the build (despite me right-clicking and "Jumping to definition" which loads the file...). How do I get my project to use C++11 header files?
Lexical or Preprocessor Issue 'memory' file not found
Lexical or Preprocessor Issue 'functional' file not found
My project settings are:
C++ Language Dialect = C++11 [-std=c++11]
C++ Standard Library = libc++ (LLVM C++ standard library with C++11 support)
The files which try to include the headers are .h
for a templated class and a .h
that is included from a .mm
implementation.
事实证明,Clang的错误消息是无益的:这些文件的根包含是一个.m
文件,编译为Objective-C,因此我将其重命名为.mm
,编译为Objective-C ++,它开始工作。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.