Code::Blocks and MinGW Installation for Windows

September 9, 2015 | Views: 6731

Begin Learning Cyber Security for FREE Now!

FREE REGISTRATIONAlready a Member Login Here

This was done on Win7 64bit OS. It’s pretty much the same on all Windows, with slight  variants. Code::Blocks is also available for Linux and Mac and has been ported to FreeBSD, OpenBSD, and Solaris.  This is geared towards beginners that want an awesome, free, open source cross-platform IDE that supports multiple compilers including GCC, Clang and Visual C++. Code::Blocks is oriented towards C, C++, and Fortran, but it can do other languages as well. It has  compilers, a code editor, a debugger, project files and build system.


If you’re going to learn programming or a second language, I would suggest learning C. It’s not easy, but it’s not as hard as some people make it out to be. There’s a ton of source code, a lot of tutorials, and most of all, it will make your Computer Kung-Fu a lot stronger.

This will explain how to install Code::Blocks [a free development environment for C and C++] on Windows with the MinGW compiler, a tool that will turn the code into programs.

You’ll need to download MinGW – Minimalist GNU for Windows first: MinGW

This is the top level directory containing Installer MinGW, MSYS and other directories.

Click on:  “Download mingw-get-setup.exeMinGW














Install it to C:\MinGW and don’t change the default directory or you’ll run into problems later on.

Pick the ones you want. I choose them all just because I’m crazy like that, but you can pick whatever you’re into. [hint: pick C and C++]

  • mingw-32-gcc-base <–C compiler, linker, and other binary tools
  • mingw-32-gcc-ada  <–ada programing
  • mingw-32-gcc-fortran <–fortran programing etc……CodeBlocks

If you’re not sure, there’s a description tab for more info.

Now, the fun part open ‘control panel ‘–>’System and Security’ –>’System’ Open ‘Advanced system settings’ then click on ‘environment variables’ 


Go down and find “Path” hit edit and at the end of the line paste:   C:\MinGW\bin

Hit ok and close all the windows.

Open up the command prompt and type:    gcc -v     You’ll get a bunch of garbage saying its installed.

Download Code::Blocks from Sourceforge  Code::Blocks

Install it, choose default, its the easiest thing to do.


Open Code::Blocks click on settings –> compiler it should take you to Global compiler settings. Click the toolchain executables tab and it should say C:\MinGW at the top. If things go sideways, just click “reset to defaults” in the Global compiler settings at the top right side.


Now you’re ready to learn how to code. 🙂
Here’s a list of resources for C programming tutorials and C programming videos.

YouTube C Programming Tutorials

source for everything C and C++

Learn how to program in C++

Share with Friends
Use Cybytes and
Tip the Author!
Share with Friends
Ready to share your knowledge and expertise?
  1. In my original it was  C:\MinGW\bin but because I made it bold the Site took out the / for whatever reason. ;C:\MinGW\bin

  2. Though this should not be new thing for a developer, but if anyone facing issues/error in Path given i.e. C:MinGWbin. FYI, this path should be actually C:\MinGWbin.

Comment on This

You must be logged in to post a comment.

Our Revolution

We believe Cyber Security training should be free, for everyone, FOREVER. Everyone, everywhere, deserves the OPPORTUNITY to learn, begin and grow a career in this fascinating field. Therefore, Cybrary is a free community where people, companies and training come together to give everyone the ability to collaborate in an open source way that is revolutionizing the cyber security educational experience.

Support Cybrary

Donate Here to Get This Month's Donor Badge


We recommend always using caution when following any link

Are you sure you want to continue?