GNU mingw compiler error: sh: gcc: command not found

14,340

Here is a link I found that solves this exact issue by modifying a line in the fstab.sample file (in my case this is the name). To summarize, add mount to the following line in fstab.sample like this

c:/MinGW/       /mingw   // Suggested* default line

mount c:/MinGW/ /mingw   // Fixed the "gcc:command not found" error for me

*Suggested by MinGW/MSYS installation guide and seems to be present by default in the file these days. This is an alternative solution and modifying path variables works.

Share:
14,340
Admin
Author by

Admin

Updated on June 04, 2022

Comments

  • Admin
    Admin almost 2 years

    I have downloaded the GNU compiler using the instructions online. Whilst compiling, I keep on getting the following error:

    sh: gcc: command not found

    I have tried to search online, but I have has no luck. Does anybody know why this is occurring, or how to fix it?

    P.S I have the mingw folder saved in C:\mingw and I am using the msys.bat compiler as suggested online which is located in C:\mingw\msys\1.0. The source .c file I am trying to compiler is located in D:\cfiles\task1.

    Thanks for your help in advance

  • Joe Plante
    Joe Plante almost 7 years
    This answer saved my sanity. The only change I had to make is mount c:/MinGW/ /mingw32 , but I bet some config scripts might be the way agrus specified.