GNU GCC compiler updating

15,493

This algorithm may help to start with programming with C++11 on Windows:

  • 1) Go to http://mingw.com and download the latest MinGW distribution, install it

    2) Download the CodeBlocks installer, install it. During installation it should detect GCC installation and propose to use it as default compiler, accept this.

    3) Start a new CodeBlocks project, go to Project -> Properties -> Build options -> Compiler settings -> Compiler flags, then set flag "Have g++ follow the coming C++0x ISO C++ language standard"

    4) Compile your first C++11 project and have fun!

By the way, the latest MinGW g++ is of version 4.6.1 as for now, so it has to support most of C++11 features.

Share:
15,493
lakshitha
Author by

lakshitha

Updated on June 04, 2022

Comments

  • lakshitha
    lakshitha almost 2 years

    I'm using code blocks with gnu gcc compiler. But when I try to compile a range base for startment it gives many errors. So I think the compiler dosn't support C++0x. So I want to know how to know the compiler version I'm using and how to update it correctly to a C++0x supporting one. I'm using Windows XP.

  • lakshitha
    lakshitha over 11 years
    thanks EarlGray... this answer did all what i wanted. great answer.. thanks a lot. first i did the first 2 steps and didnt do the 3rd one. then a compiller errarerror: range-based 'for' loops are not allowed in C++98 mode then i did the step 3 also, now all are correct. thanks again and again.
  • pidabrow
    pidabrow over 11 years
    Here is MinGW "distro" with GCC 4.7.2, with newest boost and more. Installation is very easy and works perfect for me. nuwen.net/mingw.html
  • Dmytro Sirenko
    Dmytro Sirenko over 11 years
    @piotr_dabrowski It's great, glad to hear GCC 4.7.2 is available.