c++11 standard library is not found (Xcode5, LLVM5.1, libc++)

匿名 (未验证) 提交于 2019-12-03 01:26:01

问题:

I want to use a C++11 standard library, regex, in Xcode 5 but I was faced with an error:

Lexical or Preprocessor Issue, 'regex' file not found.

OS: OSX 10.9 (Mavericks)
XCode: Version 5.1.1

Build Setting:

I changed just Apple LLVM 5.1 settings.

C++ Language Dialect -- C++11[-std=c++11]

C++ Standard Library -- libc++(LLVM C++ Standard Library with C++11 support)

Enable C++ Exceptions -- yes

Enable C++ Runtime Types -- yes

Code:

#include <regex> #include <iostream>  int main(void) {     auto reg = std::regex("(hello)+");     auto words = "hello hellohello h e l l o";     std::cout << std::boolalpha << std::regex_match(words, reg) << std::endl; } 

How can I fix this?

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!