MinGW Distro installation issue
I'm trying to install MinGW di开发者_高级运维stro following the steps here: http://nuwen.net/mingw.html#install
But, when I try to run: gcc --version
at my command line I get the following:
'gcc' is not recognized as an internal or external command, operable program or batch file.
Why is that?
Thanks.
You need to set up your PATH
environment variable so that the command interpreter finds the gcc
program.
E.g. (since you’re working in the Windows [cmd.exe] command interpreter)
set path=%path%;%programfiles%\mingw\bin
You have to use the path that applies to your system and your installation of the compiler.
You can set up a more permanent path via the Environment button in the System applet in the Control Panel. You can also do it more low level via the registry (e.g. command regedit
). And in other ways.
By the way,
for C++ programming use g++
, do not use gcc
directly.
At least if you want to avoid trouble. Of course you can do manually what g++
does. But much easier to use g++
; that’s what it’s for.
Cheers & hth.,
The command prompt cannot find the program 'gcc'. It's most likely because you have something wrong with the environment variable. If the pathname given in the environment variable is at all incorrect or non-existent (if you have the folder in another place), then command prompt will not be able to find it.
精彩评论