'The term 'g++' is not recognized as the name of a cmdlet, function, script file, or operable program [closed]

Could you guys tell me why a simple c++ file can't work and gives me errors in the terminal.Is it a simple error? Thank you.The photo is on the link:

enter image description here

c++


Solution 1:[1]

You are invoking g++ in Windows. You must guarantee that this compiler and the relevant development tools are installed and configured correctly first.

These are the prerequisites before you start to use them:
https://code.visualstudio.com/docs/cpp/config-mingw#_prerequisites

You can refer to:

  • Instructions on the MSYS2 website to install Mingw-w64.
  • VSCode tutorial Using GCC with MinGW, this is quite clear, for example prerequisites point 4 tells you how to add the path to your Mingw-w64 bin folder to the Windows PATH environment variable carefully.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Gino Mempin