“g++” is not recognized as an internal or external command, MinGW

匿名 (未验证) 提交于 2019-12-03 02:15:02

问题:

On my computer I have Windows 7 x86. I installed MinGW, I wrote the path but when I go in cmd.exe and write g++ -v it says:

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

But when I write the make -v command it recognizes it. I need this for school, I work in Eclipse, I even installed the latest java(I saw it must be installed).

回答1:

Seeing that the make command works fine, I think you forgot to mark the mingw-gcc-g++ package in the MinGW Installation Manager.

Run the MinGW Installation Manager again and mark mingw-gcc-g++ for installation and press Apply Changes



回答2:

You have to modify environment variables. Do the following:

  • From the desktop, right-click Computer and click Properties.
  • From the Computer Properties window, click Change Settings
  • In the System Properties window which opens up, click on the Advanced tab.
  • In the Advanced section, click the Environment Variables button.
  • Finally, in the Environment Variables window (as shown below), highlight the Path variable in the Systems Variable section and click the Edit button. Add or modify the path lines with the paths you wish the computer to access. Each different directory is separated with a semicolon as shown below.

    C:\Program Files;C:\Winnt;C:\Winnt\System32

Additionally you may refer to this link



回答3:

I had the same problem in Sublime..

Right click on my computer Advanced system settings Environment variables in system variables, change path to location of '...\MinGW\bin' 

Example: D:\work\sublime\MinGW\bin



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!