C++ Compiling and Building Compiling with Code::Blocks (Graphical interface)


Example

  1. Download and install Code::Blocks here. If you're on Windows, be careful to select a file for which the name contains mingw, the other files don't install any compiler.

  2. Open Code::Blocks and click on "Create a new project":

    enter image description here

  3. Select "Console application" and click "Go":

    enter image description here

  4. Click "Next", select "C++", click "Next", select a name for your project and choose a folder to save it in, click "Next" and then click "Finish".

  5. Now you can edit and compile your code. A default code that prints "Hello world!" in the console is already there. To compile and/or run your program, press one of the three compile/run buttons in the toolbar:

    enter image description here

    To compile without running, press Build, to run without compiling again, press Run and to compile and then run, press Build and run.

    Compiling and running the default "Hello world!" code gives the following result:

    enter image description here