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

2020-02-10 14:19发布

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).

3条回答
你好瞎i
2楼-- · 2020-02-10 14:45

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楼-- · 2020-02-10 14:46

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

查看更多
倾城 Initia
4楼-- · 2020-02-10 14:48

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

查看更多
登录 后发表回答