How to Install Code::Blocks: A Beginner’s Guide to Setting Up a Free C/C++ IDE

E

EL BAHJA Khalid

Apr 28, 2026 • 5 min read

How to Install Code::Blocks: A Beginner’s Guide to Setting Up a Free C/C++ IDE

Learning to code is incredibly rewarding, but the first step—setting up your development environment—can sometimes be the most frustrating part. If you're starting your journey with C or C++ and want to avoid the complexities of advanced IDEs, Code::Blocks is the perfect place to start. It's a free, open-source, and cross-platform Integrated Development Environment (IDE) that is widely used in universities and coding bootcamps specifically because it reduces setup complexity. This guide will walk you through the entire process of installing Code::Blocks on Windows and Linux, making sure you're ready to write and run your very first program.

Why Choose Code::Blocks?

Before we get into the installation steps, here's a quick look at what makes Code::Blocks a popular choice for beginners:

  • Completely Free and Open Source: Licensed under the GPL-3.0, there are no hidden costs, subscriptions, or online accounts required.

  • True Cross-Platform Functionality: It runs consistently on Windows, Linux, and macOS (with some limitations), ensuring you can work across different operating systems.

  • All-Inclusive Tool: The "MinGW" version for Windows includes the GCC compiler and GDB debugger, so you can start compiling code right away after installation.

  • Built-In Reliability: The official release includes features like custom build systems, parallel builds, breakpoint support, syntax highlighting, and code completion to help you write better code faster.

Download Code::Blocks

The official website is your single source for all the safe and correct installation files.

To get the right installer, simply visit the site below and navigate to the downloads page for the latest stable release (at the time of writing, 25.03). Choosing the correct version is crucial for a smooth start.

System Requirements

Code::Blocks is notably lightweight, meaning it will run smoothly on a variety of hardware without slowing down your system:

  • Processor: Any modern processor (Intel, AMD, or Apple Silicon for Mac).

  • Memory (RAM): A minimum of 512 MB is required, though 1 GB or more is recommended for a smoother experience.

  • Storage: The base installation requires around 500 MB of free disk space.

  • Operating Systems: Windows 7/8/10/11, most modern Linux distributions (Ubuntu, Fedora, etc.), and macOS.

  • Compilers & Build Tools: Code::Blocks supports a wide range of compilers including GCC, Clang, and Visual C++, giving you flexibility in your development environment.


Setting It Up on Your Computer

Here are the step-by-step instructions for the most common operating systems.

Step-by-Step for Windows 10/11

This is the most common setup. The key is to download the installer that includes the MinGW compiler so you can compile code immediately.

  1. Navigate to the Official Binaries Page: Go to the official Downloads page. From there, click on "Download the binary release".

  2. Download the Correct Installer: Look for the Microsoft Windows (64 bit, default) section. You will see several files. Download the one named codeblocks-25.03mingw-setup.exe (or the latest version number available). This file includes the IDE, all plugins, and the MinGW compiler suite.

  3. Run the Installer: Once the download is complete, double-click the .exe file to launch the installation wizard.

  4. Follow the Installation Wizard:

    • Click Next on the welcome screen.

    • Click I Agree to accept the license terms.

    • On the "Choose Components" screen, keep the default "Full: All plugins, all tools" selected and click Next.

    • On the "Choose Install Location" screen, you can choose the default path (C:\Program Files\CodeBlocks) or a custom one. As a best practice, avoid using paths with spaces or special characters.

    • Click Install.

  5. Launch the IDE: Once the installation is complete, you can leave the "Run Code::Blocks" box checked and click Finish.

That's it! You now have a fully functional C/C++ IDE on your Windows machine.

Step-by-Step for Linux (Ubuntu/Debian)

For Linux users, installation is typically done through the terminal.

  1. Update Your Package List (Highly Recommended): Open a terminal (using Ctrl+Alt+T) and run the following command to ensure you're getting the latest available software versions: sudo apt update.

  2. Install Code::Blocks: Next, type this command and press enter: sudo apt install codeblocks.

  3. Install Optional Plugins (Recommended): This package ( codeblocks-contrib ) contains many extra plugins that add valuable features, such as GUI design tools and advanced code formatting: sudo apt install codeblocks-contrib.

  4. Launch Code::Blocks: You can launch the IDE either by searching for it in your applications menu or by typing codeblocks directly in the terminal.

Setting Up on macOS

While the latest macOS version (13.12 from 2013) is quite old, many users successfully compile and run newer versions. MacPorts is one way to get a slightly more recent version (17.12). Alternatively, for the best experience on macOS, many developers prefer using other IDEs like Xcode or even Visual Studio Code with C++ extensions.


First Launch Configuration and Troubleshooting

After installation, you might run into a common issue: the compiler isn't automatically detected. Here's how to fix it.

Fixing Compiler Setup on Windows

If you installed the MinGW version of Code::Blocks, the compiler is already on your system. You just need to point the IDE to it. If you see a warning popup about a missing compiler, follow these steps:

  1. Open Compiler Settings: Go to the top menu and click on Settings > Compiler.

  2. Set the Correct Compiler: In the dialog box that appears, ensure "GNU GCC Compiler" is selected at the top of the left-hand list. If it isn't, select it and click the "Set as default" button.

  3. Locate the Compiler: Navigate to the "Toolchain executables" tab at the top.

  4. Auto-Detect: Click the "Auto-detect" button. If Code::Blocks finds the MinGW folder within its own installation directory, it will automatically fill in the compiler path. If it doesn't, you can manually click the "..." button to browse to and select your Code::Blocks installation directory (e.g., C:\Program Files\CodeBlocks).

  5. Click OK to save your settings.

Enabling Support for Modern C++ on Windows

If you want to use features from C++11 or later, you'll need to enable it manually for each project:

  1. Follow the guide above to open the Settings > Compiler dialog.

  2. Go to the Compiler settings tab.

  3. Check the box that says "Have g++ follow the C++11 ISO C++ language standard [-std=c++11]".

  4. Click OK.

Common Issues and Solutions

  • "Environment error - Can't find compiler executable...": This means the IDE can't find the MinGW GCC compiler. Follow the steps in the "Fixing Compiler Setup" section exactly to resolve it.

  • "Code::Blocks is not responding" or crashes: This is often due to a corrupted installation. Try uninstalling and reinstalling the program. For Windows users, ensure you have the latest graphics drivers installed, as older drivers can cause IDE rendering issues.

  • Compilation errors on first run: This is almost always a path issue where the compiler is not found. Re-verify the compiler settings to ensure the path is correct.


Hitting the Ground Running: Your First Project

To make sure everything is working correctly, let's quickly run a test program:

  1. Open Code::Blocks from your desktop or start menu.

  2. In the IDE, click File > New > Project....

  3. Select Console application from the list and click Go.

  4. Follow the wizard: click Next >, choose C++ as the language, and click Next again.

  5. Give your project a title, like "MyFirstHelloWorld", and choose a location to save it.

  6. Ensure the compiler is set to "GNU GCC Compiler" and click Finish.

  7. In the project tree (usually on the left side of the screen), open Sources > main.cpp.

  8. You should see a classic "Hello World!" program already written for you.

  9. Press F9 to build and run the program. If you see a black console window pop up with the line "Hello World!", congratulations—your IDE is set up perfectly!

Verdict and Next Steps

Code::Blocks is an excellent IDE for any beginner looking to learn C or C++ without the fuss of manually configuring compilers and linkers. Its simplicity, cross-platform nature, and active community support make it a reliable choice for your programming journey. Now that you have it installed and configured, you can focus on what really matters: learning to code.

Download Code::Blocks now for free from the official website and get started on your first project today!

Editor's Note

This article is based on the latest stable release of Code::Blocks at the time of writing. For more advanced features, detailed plugin information, or to contribute to the project, visit the official Code::Blocks Wiki and Forums.

Want more like this?

Join EL BAHJA Academy to get deep-dive tutorials and professional roadmaps.

Join the Academy