Depends on whether your MinGW bin folder is in PATH.
If it isn't and you installed the C::B+MinGW bundle, then the compiler binaries are located in CodeBlocks\MinGW\bin.
Change to that directory or add it to PATH.
If it complains that it can't find the gcc "command", be sure to start the shell in the directory where GCC is in, or repeatedly change directory (cd command) until you're there, where gcc.exe awaits.
The more elegant solution is to: right click
Computer -> Properties -> Advanced System Settings -> Advanced tab -> Environment Variables...
Look for Path at System Variables area then edit Variable Value as follows: