0

Hi I'm a beginner at c++, I was trying to compile some code in vs code and I got this error: 'g++' is not recognized as an internal or external command, operable program or batch file. I'm just wondering how to fix this, whenever I try to compile in the command line I get a similar error?

Blastfurnace
  • 18,411
  • 56
  • 55
  • 70
  • it seems that you don't have installed g++, or perhaps not in the search path. Anyway, you are saying too little to know. Please be more specific. What OS are you using? What build system? Makefile? CMake? – DeltA Jan 05 '21 at 03:37
  • 1
    It may help to use Visual Studio Community, which is a full IDE and has a much easier path to compiling things. – tadman Jan 05 '21 at 03:39
  • Check again you have the compiler installed and it's path is correctly configured in vscode. – DeltA Jan 05 '21 at 03:43
  • 1
    Does this answer your question? ['g++' is not recognized as an internal or external command, operable program or batch file](https://stackoverflow.com/questions/38652211/g-is-not-recognized-as-an-internal-or-external-command-operable-program-or) There is also [Getting: 'g++' is not recognized as an internal or external command, operable program or batch file](https://stackoverflow.com/questions/62013146/getting-g-is-not-recognized-as-an-internal-or-external-command-operable-pr), if you want a dupe that mentions VS Code specifically. – JaMiT Jan 05 '21 at 03:51

1 Answers1

0

First, you need to install a compiler(MinGW).

Now RightClick on My Computer
goto Advanced System Settings 
Environment Variables
now there in system variable goto path
in that add the file location of MinGW\bin folder
save it and restart VScode
Karan Singh
  • 183
  • 1
  • 9