When I compile a project under Qt Creator 2.8 / Qt5.1 with VS 2010 all is fine. If I do the same with MinGW I get the following error.
error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
I understand I need to enable C+11, but I have CONFIG += console c++11
in my .pro file. Is this not what is needed? What am I doing wrong?
When I look at the make I see:
CXXFLAGS = -pipe -fno-keep-inline-dllexport -g -std=c++0x
Confusing, as I say c++11 in the pro file.
- Have deleted everything, run
qmake
etc, from the scratch, no result - As said, with VS2010 it works
- Using the MinGW with gcc 4.8.0 from here. http://qt-project.org/downloads
- If this matters, Win7 32
Checked:
- No ANSI: c++11 #include <thread> gives compile error
- std=c+11 MinGW: C++11 functionality with MinGW
Found solution, but can only accept it in some time: https://mcmap.net/q/621243/-qt-config-c-11-but-std-c-0x
-std=c++0x
also works with older versions of the compiler. – Bhili-std=c++0x
and-std=c++11
the same. You might try adding-v
to theCXXFLAGS
to get details on exactly which compiler and which include directories are being used. – Reject