Home > Mobile >  g is recognized by cmd but not by vs code
g is recognized by cmd but not by vs code

Time:09-30

I'm trying to set c/c environment in my visual studio code. I have installed the mingw and set the environmental variable of the bin folder. However upon running a code in vs code, it shows the following error:

g : The term 'g ' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:40 cd "e:\vsCodes\Cpp Codes" ; if ($?) { g threen1.cpp -o threen1 } ; ... CategoryInfo : ObjectNotFound: (g :String) [], CommandNotFound Exception FullyQualifiedErrorId : CommandNotFoundException

But command prompt shows the following message when I enter g --version:

g (tdm64-1) 10.3.0 Copyright (C) 2020 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

I have tried solving the issue following the answers in enter image description here

In powershell you can verify that g in PATH running this command echo $env:path, it's powershell equivalent of echo %PATH%

  • Related