Quick Reference - Using Code::Blocks


Using Code::Blocks

Quick jump: Create project | Open an existing project | Add a new file | Add an existing file | Finding your text file output/input | Finding your source files | Building your code

How to install and use Code::Blocks:

Create a project

Click on the Create a new project option from the front page.

Select Empty project and click Go.

First, set your Folder to create project in. Use the ... button to navigate on your hard drive.

Make sure you put your project inside your repository folder.

Next, set the Project title. Then click Next.

Both the Debug and Release options should be selected. Click Finish at this screen.

Open an existing project

Locate the .cbp file on your computer. Double-click that to open the already made project.

Add a new file

Go to the File drop-down menu, open the New sub-menu, and select Empty file.

 

It will ask if you want to save the file. Select Yes and name your source file with .cpp or .h/.hpp.

 

Set your file's name (it must end with either .cpp or .hpp or .h, the first file should be a .cpp file). Click Save afterwards.

 

Make sure the file is selected for both Debug and Release and click OK.

 

Add an existing file

Right-click on the project under the Projects pane. Select Add files...

 

Locate the file(s) you want to add and click Open.

Make sure the file is selected for both Debug and Release and click OK.

 

Finding your text file output/input

Text files will be generated to, or expect to be read from, the path of your .vcxproj file. You can quickly find this path by right-clicking on your project in the Solution Explorer and click Open Folder in File Explorer.

Finding your source files

Text files will be generated to, or expect to be read from, the path of your .vcxproj file. You can quickly find this path by right-clicking on your project in the Solution Explorer and click Open Folder in File Explorer.

Building your code

You can build your code by going to Build and then selecting Build. You can also use the keyboard shortcut CTRL+F9 to build.

It will take a short amount of time to build and the results will be displayed below in the Build log window. If there are any build errors, they will be listed in the Build messages pane.