Akash Chandwani
Akash Chandwani

Reputation: 550

codeblocks shows error: This file requires support for the ISO C++ 2011 standard

I want to use poisson_distribution template in my C++ code (included in random header), but cant find a way to compile it without error

My codeblocks shows an 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.

I remember while installing codeblocks I installed only gnu c/c++ compiler. Can anyone explain me how to update my compiler to standard ISO C++ 2011 standard or suggest an alternative.

Thanks in advance...

Upvotes: 1

Views: 24205

Answers (3)

Ramisa Anjum Aditi
Ramisa Anjum Aditi

Reputation: 794

Settings > Compiler > select the checkbox: 'Have g++ follow the C++11 ISO C++ language standard'

Upvotes: 0

Joe
Joe

Reputation: 2452

A simple option would be to write

-std=c++11

As part of the other compiler options flags or directly in your Makefile.

Note that some projects may require -std=gnu++11 which is like C++11 but has some GNU extensions enabled.

Upvotes: 2

coyotte508
coyotte508

Reputation: 9725

You don't need to update the compiler. You just need to set it to C++11 mode.

How can I add C++11 support to Code::Blocks compiler?

Upvotes: 3

Related Questions