CodeBlocks 8.02 Projects for Windows

Home | Install | Projects 

The details of the software tools to write programs in C++ varies quite a bit between vendors.  Lets get into the habit of making new projects.  Start up CodeBlocks and make a new project

Start => Programs => CodeBlocks => CodeBlocks
If a compiler choice window pops open, click to accept the default GCC.&nbs; In tne CodeBlocks window select the following to create a new project:
File => New => Project...
In the "New from Template" window that apprears next, click to select the Console Application icon and click 'Go' and then 'Next' to proceeed.
Pick console application target
Pick console application target

In the next window, click to choose the 'C++' programming language and then click 'Next'.

Pick a programming language
Pick a programming languge to use

Enter the project title, location fo rthe project, and name of file to store the actual project information.  

Project title and location
Project title, location, and filename

In the next window, click 'Finish' to accept the last few details provided.  You now have a project.  In the 'Management' pane, click the 'Projects' tab and click the icons so the project tree appears.

Project Tree
Project tree

Notice that a initial file has already been created for you, its named main.cpp.  Double click to open main.cpp.  This file is a simple file automatically generated, to get you started.  Insert some text so that the file will look like the following:

Source code for main
Source code for main

To compile, link, then run the code, click the 'Build and Run' button

Build and Run button
Build and run button

After a few moments a winodw pops open with the program output.

"Hello world!" output screen shot
Program console output

Pressing a keyboard key will make the console disappear.  This concludes our first example project using CodeBlocks.
Written by: Jonathan Hill
Revised: Sat Mar 22 16:40:16 EDT 2008