'Using Git Bash unable to compile C code: "gcc:command not found"
I am trying to compile a winsock code using git bash as a terminal I installed MINGW and git bash lstest version but when I use gcc main.c -o main.exe it gives gcc:command not found
Solution 1:[1]
Use windows terminal instead of git bash. Git bash can't run gcc command. I have also faced the same problem. Hope you will find your solution.
Solution 2:[2]
I was having a similar problem - assuming you are using windows, make sure your downloaded MinGW folder is in your GIT folder (C:\Program Files\Git\MinGW). I then copied the bin folder from MinGW into the mingw64 (C:\Program Files\Git\mingw64\bin) bin folder - which then recognized gcc as a command.
One issue to note that I am still having, is when I try to compile files and create object files using the -o flag, I am not creating anything. I'm still looking into this, but I hope some of this instruction helped to at least get the command recognized.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Abidur Rahman Arko |
Solution 2 | Boylej |