Error: 'g++' could not be spawned. Is it installed and on your path?

Error: 'g++' could not be spawned. Is it installed and on your path?

在 Atom 编辑器中尝试 运行 c++。

我在 Atom 编辑器文件中安装了 'gpp compiler'==>设置==>包==>'gpp-compiler' 我还安装了 gcc-core-9.2.0-1-mingw32-bin 并在 PATH 变量中提供了它的 \bin 路径。 在 运行 编写简单的 C++ 代码时,我仍然收到此错误。

Error: 'g++' could not be spawned. Is it installed and on your path?

任何帮助!

步骤如下:

  1. 在 Atom 编辑器中安装 gpp 编译器。文件==>设置==>包==>搜索'gpp-compiler' ==>安装。
  2. 前往 https://sourceforge.net/projects/mingw/files/ 并下载 migw-get-setup.exe。通过 运行 安装它并选择所有可执行文件。
  3. 默认情况下,MingW 安装在 C:\MingW 中。在环境变量 "C:\MingW\bin" 或安装二进制文件的位置设置 PATH。
  4. 在命令终端中通过 运行 g++ --version 验证是否安装了 g++。
  5. 现在,以 'Run as Administrator' 身份打开 Atom 编辑器并创建一个 hello world cpp 文件并右键单击它 ==> 'Compile and Run'

完成!!