Google
 
Webcprogramming.com




An Affiliate of AIHorizon




Setting Up Code::Blocks and the MINGW Compiler on Windows

By Thomas Carriero

This tutorial will provide you with detailed instructions for a standard installation of Code::Blocks and the MINGW compiler, a free development environment for C and C++.

Step 1: Download Code::Blocks

  • Go to this website: http://www.codeblocks.org/downloads.php
  • Find subsection Code::Blocks IDE (Windows binaries)
  • Click on the link Code::Blocks IDE, with MINGW compiler
  • Save the file to your desktop. It is roughly 14 megabytes.

Step 2: Install Code::Blocks

  • Double click the installer.
  • Hit next several times. Other setup tutorials will assume you have installed in C:\Program Files\CodeBlocks (the default install location), but you may install elsewhere if you like
  • Do a Full Installation
  • Launch Code::Blocks

Step 3: Running in Code::Blocks

You will be prompted with a Compilers auto-detection window:

Compiler Auto-Detection Window

When you get the compiler auto-detection window, just hit close. Click on the File menu, hit "New project"

The following window will come up:

New Project Window

Click on "Console Application" and hit the "Create" button.

You will now be prompted with where you'd like to save the console application. I'd recommend you put it in its own folder, as it may create several files (this is especially true if you create other types of projects).

You can now open the main.cpp file on the left:

Main Editor View

At this point, you will have your main.cpp file, which you can modify if you like. For now, it just says "Hello World!", so we can run it as is. Hit F9, which will first compile it and then run it.

Running Program

You now have a running program! You can simply edit main.cpp and then hit F9 to compile it and run it again.

-----
Interested in advertising with us?
Please read our privacy policy.
Copyright © 1997-2005 Cprogramming.com. All rights reserved.