Skip to content
Physics and Astronomy
Home Our Teaching Resources C programming codeblocks.html
Back to top

C programming on your Linux or MS Windows laptop

For a programming environment under Linux or MS Windows we now recommend using the same system we will be using during classes, Code::Blocks. This is free software.

Downloads

Once you are on the Code::Blocks web site the easiest way to download it is to just choose the Downloads ... Binaries link from the left-hand sidebar.

NB: when installing Code::Blocks put it ito a folder whose name does not contain spaces or other "funny" characters. Use a folder name that would be a legal C variable name! (Although feel free to use capitals.)

MS Windows version

These are normally a two or three possible downloads and it's important to use the right one. Look for the IF UNSURE advice.

Using Code::Blocks

Compiler options

We strongly recommend using the same compiler settings as we are using in-class. You should only need to do this once for it to apply to all projects. NB: these are already set on our machines, but you will need to set them up if you have installed Code::Blocks yourself.

To set your compiler options

Go to the "Settings" menu and choose "Compiler".

An panel such as this should appear:

It should open showing the "Compiler settings" tab and the "Compiler Flags" sub-tab. Click on the checkboxes for:

-g
-Wall

(Note that the options appear at the end of the line of text for each option.)

Other options sub-tab

Now click on the "Other options" sub-tab and manually enter:

-std=gnu99
-Werror
Log in
                                                                                                                                                                                                                                                                       

Validate   Link-check © Copyright & disclaimer Privacy & cookies Share
Back to top