For those that have trouble with the compiler auto-detection under Windows. Assuming you have installed the right setup (C::B with MinGW compiler!) then the fix should be easy. Use your favourite editor to open the file:
[CodeBlocks_20.03_Installation_Folder]\share\CodeBlocks\compilers\options_gcc.xml
In the upper part, in the section "<if platform="windows">" remove the prefix "mingw32-" (including the minus) for the C, CPP and LD entry.
Then, the auto-detection should work fine. If you do that directly after the installation and before you start C::B the first time it should detect the right compiler