使用MinGW或VS2012编译器在Qt上启用C ++ 11支持

咖啡因

我刚刚安装了QtSDK,但在尝试使用正则表达式功能时遇到了一些问题

编译程序时出现此错误:

#error This file requires compiler and library support for the upcoming ISO C++ standard, C++0x. This supports currently experimental, and must be enabled with the -std=c++0x or -std=gnu++0x compiler options.

我试图将其添加到我的项目文件中:

QMAKE_CXXFLAGS += -std=c++0x

QMAKE_CXXFLAGS += -std=gnu++0x

但是我得到更多其他错误。在Code :: Blocks正则表达式上工作正常,并且也在使用MinGW。那么如何在QtSDK上使用C ++ 11功能呢?

Siyuan Ren

在.pro文件中,添加以下行

CONFIG += c++11

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章