Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 225
Amber Roxanna Avatar asked Aug 11 '13 18:08

Amber Roxanna


People also ask

How do you add C compiler in Code::Blocks?

Run the downloaded installer. Accept the default options. Verify the Compiler's and Debugger's Path: (For CodeBlocks 13.12 For Windows) Goto "Settings" menu ⇒ "Compiler..." ⇒ In "Selected Compiler", choose "GNU GCC Compiler" ⇒ Select tab "Toolchain Executables" ⇒ Check the "Compiler's Installation Directory".

How do I know if G ++ supports C++11?

To see if your compiler has C++11 support, run it with just the --version option to get a print out of the version number. Do this for whichever compiler(s) you wish to use with Rosetta. Acceptable versions: GCC/g++: Version 4.8 or later.

What is a C++11 compiler?

C++11 is a version of the ISO/IEC 14882 standard for the C++ programming language. C++11 replaced the prior version of the C++ standard, called C++03, and was later replaced by C++14.

Does Code::Blocks support C ++ 17?

in codeblocks There isn't a C++17 option in the Build or Compiler options, only C++14 how can i enable it in codeblocks so that both coding tools and compiler support it? Pass -std=c++17 as an option to the compiler (if using clang or gcc). Then avoid it and use the Boost equivalent.


2 Answers

  1. Go to Toolbar -> Settings -> Compiler
  2. In the Selected compiler drop-down menu, make sure GNU GCC Compiler is selected
  3. Below that, select the compiler settings tab and then the compiler flags tab underneath
  4. In the list below, make sure the box for "Have g++ follow the C++11 ISO C++ language standard [-std=c++11]" is checked
  5. Click OK to save
like image 195
rovyko Avatar answered Oct 24 '22 02:10

rovyko


The answer with screenshots (put the checkbox as in the second pic, then press OK):

enter image description here enter image description here

like image 40
Vityata Avatar answered Oct 24 '22 03:10

Vityata