I installed gnu GCC and GDB with MSYS2.
This is the command I used:
pacman -Syu
pacman -S --needed base-devel mingw-w64-x86_64-toolchain
I added environment variable "C:\msys64\mingw64\bin" and I changed the compiler location in Code::Blocks.
It works well in "compile & run", but when I'm debugging, at the last line of the main function, it shows this error:
C:\M\B\mingw-w64\crt\crt.exe.c not found
I tried other MinGW versions, such as 8.1.0, and it worked out well. I also tried Cygwin, but it started debugging and finished.
gdbmanually for small projects. For larger projects, I've become a fan of VSCode (or vscodium) as an IDE. Yes, like all IDEs it has a learning curve, but the MS documentation is quite good -- even for Linux use. Your install looks fine, the-toolchainpackage is just a meta-package that installs a number of gcc utilities (includinggdb), theC:\M\B\mingw-w64error doesn't match your"C:\msys64\mingw64\bin"path - double-checkmain(), so it tries to opencrtexe.cwhich is where main was called from. Why is that a problem?