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

I am writing code that requires C ++ 11 support for my code :: Blocks 12.11. I use the standard GNU GCC Compiler that comes with MingW. Is there any way to do this?

+55
c ++ 11 codeblocks
Aug 11 '13 at 18:02
source share
3 answers
  • Go to Toolbar -> Settings -> Compiler
  • From the Selected compiler drop-down menu, make sure the GNU GCC Compiler selected
  • Below, select the compiler settings tab, and then the compiler flags tab under
  • In the list below, make sure the " Have g++ follow the C++11 ISO C++ language standard [-std=c++11] " Have g++ follow the C++11 ISO C++ language standard [-std=c++11] .
  • Click OK to save
+110
Jun 25
source share

A simple way is to write:

 -std=c++11 

in the "Other Options" section of the compiler flags. You can do this on the basis of each project (Project → Build Options) and / or set it as the default parameter in the "Settings → Compilers" section.

For some projects, -std=gnu++11 may be required, which is similar to C ++ 11 but has some GNU extensions.

If you are using g ++ 4.9, you can use -std=c++14 or -std=gnu++14 .

+11
May 26 '15 at 5:18
source share

Answer with screenshots (check the box as in the second figure, then click OK):

enter image description here enter image description here

+10
Apr 29 '17 at 23:02 on
source share



All Articles