Why is GCC not Recognized as Internal or External Command? This article helps you, how you can fix this problem. If you installed MinGW tools on your system, then you are trying to run GCC from Command prompt, sometimes you will see get this error – “GCC” is not recognized as an internal or external command. Let’s see how can you solve it by command prompt.
Read Also: How to Shutdown or Reboot Remote Computer from Command Line
At first, you need to check, what all you have in your “PATH” environment variable. Just the set path and verify.
c:\>set path Path=C:\Program Files (x86)\Windows Resource Kits\Tools\;C:\WINDOWS\system32;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;c:\Program Files\Java\jdk1.7.0_79\bin;C:\Program Files (x8 6)\Skype\Phone\;C:\Program Files (x86)\Quarantine\;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Windows Resource Kits\Tools\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\ Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;c:\Program F iles\Java\jdk1.7.0_79\bin;C:\Program Files (x86)\Skype\Phone\;C:\Program Files (x86)\Quarantine\;c:\Program Files (x86)\Mozilla Firefox"
You can also use “findstr” to quickly check if it has “mingw” anywhere in the string.
c:\>set path | findstr /I /C:"mingw" c:\>
Secondly, if you did not add the MinGW installation folder yet to the path. Just follow the next step how to do this.
Thirdly, any user easily can be edited in GUI and various way to open the window, where you can edit it. When you press the button of windows and start typing the “environment” and you will see the search results like below-
Read Also: How to find DNS address of Website
4th step, you need to select the “Edit system environment variables”. Now, you can edit the system variables.
5th step, just you find the “PATH” environment variable and just edit it to add MinGW path. You will need to add ‘;’ at the end of the existing value and finally enter MinGW path.
After doing the above steps, just you need a new command prompt and run gcc to comile a C program.
c:\>type helloWindows.c #include int main() { printf("Hello Windows"); } c:> c:\>gcc -o HelloWindows.exe helloWindows.c c:\> HelloWindows.exe Hello Windows
Just you need to confirm, firstly add the path to system environment variable or not user environment variable. Secondly, open a new window after setting PATH.
Check Also: How to Check If WiFi is Connected