I'm writing some code that requires to have C++11 support for my Code::Blocks 12.11. I am using default GNU GCC Compiler came with MingW. Is there any way I can do this?
Asked
Active
Viewed 1.3e+01k times
4 Answers
137
- Go to
Toolbar -> Settings -> Compiler
- In the
Selected compiler
drop-down menu, make sureGNU GCC Compiler
is selected - Below that, select the
compiler settings
tab and then thecompiler flags
tab underneath - In the list below, make sure the box for "
Have g++ follow the C++11 ISO C++ language standard [-std=c++11]
" is checked - Click
OK
to save

rovyko
- 4,068
- 5
- 32
- 44
15
A simple way is to write:
-std=c++11
in the Other Options section of the compiler flags. You could do this on a per-project basis (Project -> Build Options), and/or set it as a default option in the Settings -> Compilers part.
Some projects may require -std=gnu++11
which is like C++11 but has some GNU extensions enabled.
If using g++ 4.9, you can use -std=c++14
or -std=gnu++14
.

M.M
- 138,810
- 21
- 208
- 365
-
This is the only one that works using the latest version of CodeBlocks. – Gugalcrom123 Mar 09 '23 at 19:10