Search code examples
cgccmingw

MinGW gcc does nothing


I installed gcc with the GUI installer MinGW Installation Manager. After it installed the basics, I manually checked and installed mingw32-binutils and mingw32-gcc. I added the directory to my path. I can use the command in powershell. If I use gcc alone I get an error because i didn't input any file, if I put in a .txt it tells me it's not recognized. So that part works as it should.

However once I put a file, main.c, whether or not it's real code (basic main with hello world) or a random string or character, absolutely nothing happens, no message, and the command terminates. So basically I enter gcc and the prompt immediately asks for another command. I reinstalled it twice.

The command:

gcc -o a.exe main.c

I'm using Windows 10 if that can help.


Solution

  • There are other things to install. See the list that you can find in the MinGW site :

    binutils (bin)
    mingw-runtime (dev and dll)
    w32api
    Required runtime libraries for GCC:
        mpc (dll)
        mpfr (dll)
        gmp (dll)
        pthreads (dev and dll)
        iconv (dll)
        zlib
        gettext
    gcc-core (bin and dev and dll)
    

    Otherwise, you can install all the required packages via the GUI manager provided with the installation of MinGW.