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

早过忘川 提交于 2019-12-31 09:48:06

问题


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?


回答1:


Open your .pro file from inside QtCreator and add this

QMAKE_CXXFLAGS += -std=c++0x


来源:https://stackoverflow.com/questions/16509932/using-qt-creator-c-11-nullptr-is-keyworded

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!