In Compiler and debugger, how does your Toolchain tab look?
Dose it look somewhat like this?
or are the text fields just blank?
What file did you download to install codeblocks?
Was it something like codeblocks-8.02mingw-setup.exe ?
Or didn't it have the mingw part in the filename?
If it did have the mingw part in it, and above mentioned text fields are blank, try to remember where you installed codeblocks, and write that path into the text field that contains 'C:\Program Files\CodeBlocks\MinGW' in the picture, then press autodetect.
if it didn't have the mingw part in the filename, you need to download the correct one http://prdownload.berlios.de/codeblocks/codeblocks-8.02mingw-setup.exe and re install codeblocks.
If you however have windows vista, they (the creators of codeblocks) advice that it may not work, and if that is the case you could try to install a newer mingw.
You can do that by running this http://downloads.sourceforge.net/project/mingw/Automated%20MinGW%20Installer/MinGW%205.1.6/MinGW-5.1.6.exe?use_mirror=freefr installer.
If that is the case, install it into a subdirectory in the codeblocks directory called mingw.
When the installer asks you which parts you want to install select "MinGW base tools", "g++ compiler" and "MinGW make".
Now, go back to the compiler and debugger settings and the toolchain tab and fill in the path to where you installed mingw and press autodetect.