Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 994
Math525 Avatar asked Sep 28 '22 10:09

Math525


1 Answers

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.

like image 198
avg Avatar answered Oct 18 '22 07:10

avg