'g++' is not recognized as an internal or external command on Windows 8 [duplicate]

StackOverflow https://stackoverflow.com/questions/22979437

  •  30-06-2023
  •  | 
  •  

Pregunta

I am trying to use MinGW on Windows, I read many posts here but still I cannot solve the problem. I am getting the following message:

'g++' is not recognized as an internal or external command ...

I have already include in my PATH I have include:

 C:\MinGW\bin;

I tried also setx and set but maybe not properly to set the g++.

My PATH is

PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32
\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-St
atic;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files (x86)\M
icrosoft ASP.NET\ASP.NET Web Pages\v1.0\;C:\Program Files (x86)\Windows Kits\8.0
\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\Tools\Bi
nn\;  C:\MinGW\bin;C:\MinGW\msys\1.0\bin; C:\MinGW\bin\g++.exe; C:\MinGW\bin\"g++.exe";     C:\MinGW\bin\g++;

I am using Windows 8 and I restarted my PC after setting the PATH.

¿Fue útil?

Solución

Your path is rather a mess. For example the entry that should be C:\MinGW\bin has several leading spaces. Windows treats all characters between the semi-colons in a path as significant characters - you need to remove those extraneous spaces.

You also have the following items in the path (some with leading spaces), which should probably be removed:

C:\MinGW\bin\g++.exe
C:\MinGW\bin\"g++.exe"
C:\MinGW\bin\g++

Note that PATH entries should not include the executable file itself, only the directory that contains the executable files you want the OS to locate in a PATH search. Also, quotes should not be included in a PATH entry; similar to spaces, the code that uses the path will treat them as actual parts of the directory name to search.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top