OK, I have now fixed my setup thanks to @eht16. The problem was I had installed a pacman package called `gcc`, then I installed `mingw-w64-i686-gcc` as well as written on the wiki page. This was very confusing. I removed gcc, reinstalled mingw-w64-i686-gcc, then I had to close MSYS2 and restart. Now I can build tm_source_file.c and spawn.c fine :-D