I tried to set CMAKE_C_FLAGS
According to the documentation the CMAKE_C_FLAGS
set C language flags for all build types. For C++ you need use CMAKE_CXX_FLAGS
instead:
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
More Related Contents:
- How to add “-l” (ell) compiler flag in CMake
- How to detect C++11 support of a compiler with CMake
- Legality of COW std::string implementation in C++11
- Cmake cannot find library using “link_directories”
- What are the advantages of list initialization (using curly braces)?
- std::thread pass by reference calls copy constructor
- Static Data Member Initialization
- Difference between std::regex_match & std::regex_search?
- What does the standard library guarantee about self move assignment?
- Calling a function for each variadic template argument and an array
- C++ unordered_set of vectors
- Can returning a local variable by value in C++11/14 result in the return value being constructed by rvalue when no copy/move is involved?
- Compiling a static executable with CMake
- std::optional specialization for reference types
- What is decltype with two arguments?
- Lambda capture as const reference?
- C++11 member initializer list vs in-class initializer?
- Are notes and examples in the core language specification of the C++ Standard non-normative?
- GNU C++ how to check when -std=c++0x is in effect?
- Clang doesn’t see basic headers
- Do these members have unspecified ordering?
- Check traits for all variadic template arguments
- Convert between string, u16string & u32string
- Has the new C++11 member initialization feature at declaration made initialization lists obsolete?
- std::thread error (thread not member of std)
- Advantage of using trailing return type in C++11 functions
- Can we apply content not explicitly cited from the normative references to the C++ standard?
- GCC std::thread not found in namespace std
- using extern template (C++11) to avoid instantiation
- When will C++0x be finished? [closed]