Yeah, this has nothing to do with code itself, but I need help. Sometimes, codeblocks will randomly say <projectname> uses an invalid compiler, nothing to be done. or something like that. I installed the mingw version, and reinstalled it multiple times, and I just can't fix it.
I don't use Code::Blocks, but you should check this out: http://www.cprogramming.com/code_blocks/ The first question under troubleshooting should solve your problem.
It usually says that when it cannot find the compiler you requested. The GNU compiler is default for Code::Blocks, so obviously Code::Blocks cannot find the GNU compiler.
Try this:
1) Go to: Settings >> Compiler and debugger.
2) Click the Toochain executables tab.
3) Press the "..." button and locate the installation directory of your MinGW compiler.
4) Click the Auto-detect button. This will automatically locate the executables within the directory you specified.