Tutorial – C++ in CodeBlocks

Step a: Install CodeBlocks

  • 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 b: 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 OK. Code::Blocks may ask if you want to associate it as the default viewer for C/C++ files–I’d suggest you do. Click on the File menu, and under “New”, select “Project…”

The following window will come up:

New Project Window

Click on “Console Application” and hit the “Go” button.

Click next until you get to the Language Selection Dialog:

Language selection dialog

You’ll be asked to choose whether you want to use C or C++. If you’re not sure, use C++. Otherwise, choose based on the language you are learning. (You can find tutorials here on both C and C++.)

After clicking “Next”, Code::Blocks will then prompt you with where you’d like to save the console application:

Project Name and Location

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 will need to give your project a name, anything will be fine.

Clicking “Next” again will prompt you to set up your compiler:

Compiler Setup

You don’t need to do anything here. Just accept the defaults by hitting “Finish”.

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

ahsan Pro copy

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s