According to Code::Blocks wiki, you need to add C:\MinGW\libexec\gcc\mingw32\MinGW-Version to your PATH. There is no need to restart, but you need to open another terminal in order to get the newest PATH settings.
For MinGW-w64, that’s <mingw install directory>\libexec\gcc\x86_64-w64-mingw32\4.7.0\