I tired downloading the suggested codeblocks-8.02mingw-setup.exe which i thought would also give me GNU GCC Compiler but it says that i dont have it and when i try to run a project it says invalid compiler [YOUR ANSWER IS ALREADY THERE. SEARCH THE FORUMS!].
Make sure there is a MinGW subfolder in your codeblocks install directory.
If it is not there (you might have accidently unchecked to install MinGW compiler suite), reinstall C::B.
If it is there open "Settings... -> Compiler and debugger... -> Global compiler settings -> GNU GCC Compiler -> Toolchain executables" and try to run the autodetection.
If it does not find the correct directory, try to add it manually, add only the base folder of gcc, the one including the bin directory, not the bin-directory itself.