GNU GCC compiler updating

泄露秘密 提交于 2019-12-10 20:43:44

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/12822851/gnu-gcc-compiler-updating

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!