After installing minGW, gcc command is not recognized
Asked Answered
K

1

7

I have installed minGW, and I have a file "test.c".

I typed gcc test.c -o demo at the command prompt, while in the directory where I saved the "test.c" file. But it didn't work; I got this message:

gcc is not recognized as internal or external command, operable program or batch file

How do I make the gcc command work on Windows with minGW?

Kort answered 25/11, 2015 at 18:27 Comment(6)
Check your $PATH variable. Is the directory gcc.exe is located in included in there? If not, add it. And do some research first. I bet there's information on that on the Internet.Theiss
I had PATH set to Java SDK. Now I changed it to MinGW. I can't add two PATH. Is it not possible to use both Java compiler and gcc compiler on the same computer?Kort
Of course it is. There should be many more paths listed in $PATH than just these two. Don't change it but append a semicolon and behind that the path to the executable.Theiss
Ok got it. Just need to use ; and add directories to other compilers: C:/compilerA/bin/;C:/compilerB/bin/Kort
for me I needed to remove the trailing backslash::: C:\MinGW\bin worked instead of C:\MinGW\bin\ Multifaceted
A more up to date duplicate: 'gcc' is not recognized - How to make gcc/mingw work in Windows?Erlina
P
1

You are missing on Path Variable settings. Refer the 'Environment Settings' section on this page :

http://www.mingw.org/wiki/Getting_Started

Poll answered 25/11, 2015 at 19:16 Comment(1)
Link is outdated, Mingw is also hard to find. Next time post short description from external page to avoid suchs situationsEscallop

© 2022 - 2024 — McMap. All rights reserved.