G++ Not found, I've already tried 3 different

2019-07-31 17:41发布

问题:

I can compile C code no problem using MinGW but for some reason I can't compile C++. I already tried other compilers, cygnus and cygwin. I'm using JGrasp. Here's the error feed:

 ----jGRASP wedge2 error: command "g++" not found.
 ----   This command must be in the current working directory
 ----   or on the current PATH to use this function.
 ----   PATH is ";C:\Program Files\Common Files\Microsoft Shared\Windows Live;
                 C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live 
                 C:\windows\system32;
                 C:\windows;C:\windows\System32\Wbem;
                 C:\windows\System32\WindowsPowerShell\v1.0\;
                 C:\Program Files (x86)\Windows Live\Shared; 
                 C:\mingw\bin;  
                 C:\cygnus\cygwin-b20\H-i586-cygwin32\bin; 
                 C:\cygwin\bin;".
 ----jGRASP: operation complete.

回答1:

As I instructed in the comments, you need to install g++ with the MinGW installer. By default, MinGW only installs the C compiler.

To get g++, tick a checkbox during installation.



回答2:

You also can use mingw-get commandline installer: mingw-get install g++

It can be useful to execute mingw-get update before.

Documentation: http://www.mingw.org/wiki/Getting_Started (section Command Line Interface Installer)