initializer_list gcc 4.8.1 ubuntu 13.10 qt4

时间:2014-05-26 09:29:30

标签: c++ ubuntu gcc

我正在开发一个使用initializer_list的软件。该软件在所有主要操作系统和不同编译器下编译良好。我自己的开发机器是带有gcc 4.6.3的ubuntu 12.04。要使用initilizer_lists,我必须使用std = c ++ 0x。

现在我正在尝试在另一台机器上编译它并获得错误

In file included from /usr/include/c++/4.8/initializer_list:36:0,
             from /usr/include/qt4/QtCore/qlist.h:55,
             from /usr/include/qt4/QtCore/qobject.h:50,
             from /usr/include/qt4/QtCore/qcoreapplication.h:45,
             from /usr/include/qt4/QtGui/qapplication.h:45,
             from /usr/include/qt4/QtGui/QApplication:1,
             from /home/chris/scripts/bin/braingl/src/main.cpp:1:
/usr/include/c++/4.8/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.

我清楚地在我的CMake文件CXX_FLAGS中设置了(-std = c ++ 11),但它仍然失败,并显示相同的错误消息。任何帮助将不胜感激。

0 个答案:

没有答案