According to this site add
CONFIG += c++11
to your .pro file (see at the bottom of that web page). It requires Qt 5.
The other answers, suggesting
QMAKE_CXXFLAGS += -std=c++11
(or QMAKE_CXXFLAGS += -std=c++0x
)
also work with Qt 4.8 and gcc / clang.
More Related Contents:
- Windows C++ compiler with full C++11 support (should work with Qt) [closed]
- Configuring the GCC compiler switches in Qt, QtCreator, and QMake
- class->methode1()->methode2() what does it mean? [closed]
- Is it possible to figure out the parameter type and return type of a lambda?
- Will two atomic writes to different locations in different threads always be seen in the same order by other threads?
- Recursive lambda functions in C++11
- How to convert a lambda to an std::function using templates
- C++11 aggregate initialization for classes with non-static member initializers
- Can’t pass temporary object as reference
- Is the size of std::array defined by standard
- constexpr and initialization of a static const void pointer with reinterpret cast, which compiler is right?
- Calling a function for each variadic template argument and an array
- std::optional specialization for reference types
- Lambda capture as const reference?
- C++11 member initializer list vs in-class initializer?
- Implementing Qt project through CMake
- Lifetime of lambda objects in relation to function pointer conversion
- Is there an automatic noexcept specifier?
- What is the easiest way to print a variadic parameter pack using std::ostream?
- Do built-in types have move semantics?
- CopyFileEx with progress callback in Qt
- How does std::end know the end of an array?
- Is writing to &str[0] buffer (of a std:string) well-defined behaviour in C++11?
- Why can’t I initialize a reference in an initializer list with uniform initialization?
- What is a C++11 extension [-Wc++11-extensions]
- Which greedy initializer-list examples are lurking in the Standard Library?
- How does std::forward receive the correct argument?
- Undefined reference to process(std::__cxx11::basic_string … ) when compiling affdex linux sample applications
- C++ view types: pass by const& or by value?
- Overload resolution with ref-qualifiers