Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to configure QtCreator to work with C++11?

I wrote some project using QtCreator 2.5.1 and Qt 4.8.0. I added to *.pro file:

QMAKE_CXXFLAGS += -std=c++0x

And all compiles and works correct, but IDE still highlights C++11-style pieces of code as wrong. E.g. this string:

QVector<int> colwi{100,70,30,40,25,25,25,25,25};

Can this be fixed?

like image 654
meldo Avatar asked Nov 25 '22 17:11

meldo


1 Answers

in your qmake .pro file, add

Qt5:

CONFIG += c++11

or Qt4:

CXXFLAGS += -std=c++11

See http://qt-project.org/forums/viewthread/24551

like image 84
mabg Avatar answered Dec 18 '22 03:12

mabg