使用Qt Creator C ++ 11,nullptr是关键字? [英] Using Qt Creator C++ 11, nullptr is keyworded?

查看:5644
本文介绍了使用Qt Creator C ++ 11,nullptr是关键字?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Qt Creator使用C ++ 11.

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;

可能有什么问题?

推荐答案

打开您的 .pro 文件并添加此

QMAKE_CXXFLAGS += -std=c++0x

这篇关于使用Qt Creator C ++ 11,nullptr是关键字?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆