I'm developing a program in Qt. Its makefile is generated automatically from the .pro file. I need to use some code which need the -std=c++11 flag to be set up for g++. Where in .pro should I add this flag? (changing only the Makefile won't work since it gets overwritten by the newly generated one, each time I build the project).
You can add the following to the Qt .pro for C++11: -
CONFIG += c++11
As of Qt 5.4, C++14 can be enabled with
CONFIG += c++14
You can change CXX flags :
QMAKE_CXXFLAGS += -std=c++11
I usually set it as :
QMAKE_CXXFLAGS += -std=c++11 -Wall -Wextra -pedantic
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With