Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Qt Creator C++ 11, nullptr is keyworded?

I'm using C++11 using Qt Creator.

"warning: identifier 'nullptr' is a keyword in C++11 [-Wc++0x-compat]"
"error: 'nullptr' was not declared in this scope"

This is on code that works elsewhere, the relevant part being:

... = nullptr;

What might be the problem?

Is this not already a keyword, isn't it's scope global?

like image 439
alan2here Avatar asked May 12 '13 17:05

alan2here


1 Answers

Open your .pro file from inside QtCreator and add this

QMAKE_CXXFLAGS += -std=c++0x
like image 198
user2348816 Avatar answered Sep 23 '22 20:09

user2348816