C++ Code::Blocks "#include <array>" causing error -
i'm using code::blocks 13.12 gnu gcc compiler , when attempt compile:
#include <iostream> #include <array> #include <iomanip> using namespace std; int main() { array< int, 20 > c1={}; array< int, 20 > c2={}; array< int, 20 > c3={}; }
it jumps header file "c++0x_warning.h" following warning:
#ifndef _cxx0x_warning_h #define _cxx0x_warning_h 1 #ifndef __gxx_experimental_cxx0x__ #error file requires compiler , library support \ iso c++ 2011 standard. support experimental, , must \ enabled -std=c++11 or -std=gnu++11 compiler options. #endif #endif
what doing wrong? sorry started studying c++ , couldn't find useful info when googling issue.
read error message, it's telling exact problem. need pass -std=c++11
or -std=gnu++11
compiler argument use std::array
, introduced c++11 standard. later standard supported compiler (e.g. -std=c++14
) work.
for specific case of codeblocks, enabling c++11 support has been asked , answered: how can add c++11 support code::blocks compiler?
Comments
Post a Comment