Can't #include <array>

The reason I am posting this under Linux programming is the I'm using Ubuntu's SDK or AKA QT Creator to develop my program. For some reason when I try to include the standard array class I get this error message:

/usr/include/c++/4.8/bits/c++0x_warning.h:32: 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.
#error This file requires compiler and library support for the \
^


How do I fix that? I am able to get it to work with other IDEs
open your project file (.pro) and type:
1
2
QMAKE_CXXFLAGS += \
    -std=c++11
Sorry for the late reply. Thank you very much!
Wait, I believe that's not the right way to do it.
It may work but you may lack the C++11 features within the IDE itself (it may not recognize lambda expressions, etc...).
Actually it's as simple as:

CONFIG += c++11
Last edited on
Topic archived. No new replies allowed.