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.
- Follow a link to download page for the second Windows option (codeblocks-13.12mingw-setup.exe) including the MingW debugger from this page.
- Execute the set-up file and accept all the defaults.
- Start Code::Blocks and select menu option
- Click the Reset defaults button and accept any invitation to continue.
- Select menu option
- Double click on the Console application icon then click the Next > button.
- Select the language C and click the Next > button.
- Name the project MyFirstC and click the Next > button.
- Accept the defaults by clicking the Finish button.
- Expand Sources in the left panel and double click on main.c to see the code for the output of Hello world!
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.
- 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.