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

95,335

Solution 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

Solution 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

Solution 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

Share:
95,335
user1274566
Author by

user1274566

Updated on August 21, 2020

Comments

  • user1274566
    user1274566 almost 4 years

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

  • Richard Tingle
    Richard Tingle over 4 years
    By "change path" do you mean "add to the path", because just changing it will make g++ work but break everything else
  • Tharindu Thisarasinghe
    Tharindu Thisarasinghe over 3 years
    Thanks a lot! The whole question is useless without this answer.