Getting Started with Code::Blocks

Code::Blocks is a free IDE for C and C++. Follow these steps to download a suitable version, install it on Windows and test it with the supplied "Hello World" console application. See the end of the page for tips on installing Code::Blocks on the Debian Linux operating system of a Raspberry Pi.

  1. Follow a link to download page for the second Windows option (codeblocks-13.12mingw-setup.exe) including the MingW debugger from this page.
  2. Execute the set-up file and accept all the defaults.
  3. Start Code::Blocks and select menu option Settings > Compiler...
  4. Click the Reset defaults button and accept any invitation to continue.
  5. Select menu option File > New > Project...
  6. Double click on the Console application icon then click the Next > button.
  7. Select the language C and click the Next > button.
  8. Name the project MyFirstC and click the Next > button.
  9. Accept the defaults by clicking the Finish button.
  10. Expand Sources in the left panel and double click on main.c to see the code for the output of Hello world!
  11. Click on the Build and run icon.
    Note that if you click on the green triangle (as in Lazarus), the executable from the last successful build will be run. After making changes either click the Build icon followed by the Run icon or click on the Build and run icon as above.
To install Code::Blocks on the Debian Linux operating system of a Raspberry Pi, use the Pi Store as instructed on the makeuseof site. We did not find the installation intuitive and offer these additional points of guidance.
  • You might already have a Pi Store icon on the desktop.
  • You need to sign up for the Pi Store by supplying your email address and a password.
  • You may receive a notification that a website is not to be trusted because of an expiry date but you can continue by following an Advanced link.
  • Select CodeBlocks by clicking the red download button beneath its icon.
  • Click on My Library to see that it is ready for download.
  • Click the green download button on the right of the screen to initiate the download.
  • When Code::Blocks is being downloaded and installed you will see a console with a log of the tasks being completed. This process will take several minutes. You might see a premature message that the download has completed. You may need to accept an invitation to continue.
  • You can access the downloaded Code::Blocks from within the Pi Store application on your Raspberry Pi by double clicking on the Code::Blocks icon or by selecting it then clicking the green Launch button.
  • We accepted all the defaults upon first use and started a new console application without a problem.
  • You may see a message that you need to close the Pi Store before opening another application. This refers to a different application in your Pi Store library; you can still open a browser as usual and copy C code into the Code::Blocks editor.
  • After installation you can start Code::Blocks directly; it will be as expected in the Programming application section together with Scratch, IDLE and (we trust) Lazarus.
  • All of our C demonstrations that we tried on the Pi worked as intended. Please let us know if you have trouble with any of them (except those on in-line assembler that are for Intel-compatible processors) on the Pi.
Programming - a skill for life!

How to apply your knowledge of Pascal when learning C/C++