I know there are duplicates .
This is my Test.pro:
CONFIG += c++14 SOURCES += main.cpp
and my main.cpp:
int main(){}
For many duplicates, this should give me C ++ 14. However, when I create a project with Qt Creator 4.2.0 with Qt 5.8.0-1 and MinGW gcc 5.3.0-1 through the maintenance tool I get
g ++ -c -pipe -fno-keep-inline-dllexport -g -std = gnu ++ 1y -frtti -Wall -Wextra -fexceptions -mthreads -DUNICODE -DQT_QML_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQTIN_MQ_IN . -IC: \ Qt \ 5.8 \ mingw53_32 \ include -IC: \ Qt \ 5.8 \ mingw53_32 \ include \ QtGui -IC: \ Qt \ 5.8 \ mingw53_32 \ include \ QtANGLE -IC: \ Qt \ 5.8 \ mingw53_32 \ include \ QtCore -Idebug -IC: \ Qt \ 5.8 \ mingw53_32 \ mkspecs \ win32-g ++ -o debug \ main.o .. \ Test \ main.cpp
which is not -std=c++14 , I expect.
I tried all kinds of tricks from other questions such as
QMAKE_CXXFLAGS_CXX14 = -std=c++14 CONFIG += c++14 QMAKE_CXXFLAGS += -std=c++14 SOURCES += main.cpp
that leads to
g ++ -c -pipe -fno-keep-inline-dllexport -std = C ++ 14 -g -std = gnu ++ 1y -frtti -Wall -Wextra -fexceptions -mthreads -DUNICODE -DQT_QML_DEBUG -DQT_GUI_LIB -DQT_QT_CT_QT_CT_CT_CT_CT_CT_CT_CT_CT_CT_CT_CTL_CT_CT_CTL_CT_CT_CTLD I .. \ Test -I. -IC: \ Qt \ 5.8 \ mingw53_32 \ include -IC: \ Qt \ 5.8 \ mingw53_32 \ include \ QtGui -IC: \ Qt \ 5.8 \ mingw53_32 \ include \ QtANGLE -IC: \ Qt \ 5.8 \ mingw53_32 \ include \ QtCore -Idebug -IC: \ Qt \ 5.8 \ mingw53_32 \ mkspecs \ win32-g ++ -o debug \ main.o .. \ Test \ main.cpp
where the second parameter overwrites the first, that is, it is still in gnu++1y -mode or just
QMAKE_CXXFLAGS += -std=c++14 SOURCES += main.cpp
which also leads to
g ++ -c -pipe -fno-keep-inline-dllexport -std = C ++ 14 -g -std = gnu ++ 11 -frtti -Wall -Wextra -fexceptions -mthreads -DUNICODE -DQT_QML_DEBUG -DQT_GUI_LIB -DQT_DQT_IBE_IBE_BORE I .. \ Test -I. -IC: \ Qt \ 5.8 \ mingw53_32 \ include -IC: \ Qt \ 5.8 \ mingw53_32 \ include \ QtGui -IC: \ Qt \ 5.8 \ mingw53_32 \ include \ QtANGLE -IC: \ Qt \ 5.8 \ mingw53_32 \ include \ QtCore -Idebug -IC: \ Qt \ 5.8 \ mingw53_32 \ mkspecs \ win32-g ++ -o debug \ main.o .. \ Test \ main.cpp
I deleted the assembly directory and the Test.pro.user file to force the assembly from scratch, nothing gave me C ++ 14.
How to tell qmake to use C ++ 14?
c ++ qt qmake
nwp
source share