If you are a student or a beginner starting out with C or C++, Code::Blocks is one of the best light, free IDEs available. However, if you head over to their official website, the download page can be incredibly confusing.
Tons of developers end up downloading the wrong file layout. Then, the moment they try to run a basic program, they are hit with a massive wall of compile errors because the IDE can't find a compiler.
In this quick guide, we’ll walk through the right way to install Code::Blocks pre-bundled with the MinGW GCC compiler and test it with a classic "Hello World" script.
Watch the 2-Minute Video Tutorial
If you prefer a step-by-step visual walkthrough, check out the full quick video tutorial directly inside the player below:
Step 1: Navigate to the Right Binary Release
- Open your browser, search for "Code Blocks download", and click on the official downloads link.
- Click on the Binary Release option.
- Scroll down carefully until you see the setup filenames.
The Golden Rule: You must download the installer that has
mingw-setupin the name (for example,codeblocks-25.03mingw-setup.exe). This specific version packages the essential GCC compiler alongside the text editor layout so it functions out of the box.
- Click the link for sourceforge.net to trigger the automatic download.
Step 2: Running the Installation Wizard
- Open the downloaded setup executable and accept the prompt to bring up the installation wizard.
- Click Next, click I Agree on the licensing terms and advance.
- Choose your desired target destination folder (keeping the standard installation directory path is highly recommended) and hit Install.
- Once the loading bar finishes processing, click Yes when prompted to launch Code::Blocks immediately.
Step 3: Setting the Default GCC Compiler
On your first startup launch, Code::Blocks will explicitly ask you to configure your compiler configurations.
- Select the GNU GCC Compiler option from the auto-detected list.
- Click to set it as your default toolchain for C/C++ files and select OK.
Step 4: Testing Your Setup (Hello World)
Let’s make sure your compiler configuration works seamlessly:
- Click File > New > Empty File.
- Press
Ctrl + Sto save the file immediately to your desktop, making sure to name it with a.cppor.cextension. - Paste a basic test script inside:
cpp
#include <iostream>
int main() {
std::cout << "Hello World!" << std::endl;
return 0;
}
Top comments (1)
Thanks for reading! I put together a quick, 2-minute video companion to this guide that walks through the exact installation file selections to help you avoid common compiler environment errors. Check it out in the article body above, and let me know if it helps get your environment up and running!