I installed separately first TDM64-GCC 5.1.0-2 (in its standard folder C:\TDM-GCC-64) and then CodeBlocks 16.1 in Windows 10. CodeBlocks detected correctly the compiler, but not gdb.
I tried to compile your "hello" project and all went OK. When I tried to debug, CodeBlocks said: "ERROR: you must specify a debugger program in the debugger's settings". In the settings the 'Executable path' field was empty and red coloured.
If I write "gdb.exe" in the field the debugger starts, but hangs on the first cout << "Hello world" line and I must use Ctrl Alt Canc to kill it.
I saw another GDB64/bin subfolder of TDM and tried with it but the result is the same. However, the "Executable path" box remains red whatever I write.
Is this a TDM problem? Is there a particular version of it I must install with CodeBlocks (I'd prefer to have a compiler folder separate from CodeBlocks one, as in your MingW download).