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

Popular posts from this blog

SVG stroke-linecap doesn't work for circles in Firefox? -

routes - Laravel 4 Wildcard Routing to Different Controllers -

cross browser - XSLT namespace-alias Not Working in Firefox or Chrome -