Reputation: 261
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).
Upvotes: 26
Views: 143568
Reputation: 689
How to Get the G++ Complier working Step by Step
--
If you dont have MINSYS you can download from here
in the Down load the installer section
--
Then download MinGW
https://sourceforge.net/projects/mingw/
and install ALL packages
--
Now add both Minsys and MinGW you your C: folder
--
Then Open Minsys there should be a mingw 32 folder and a mingw 64 folder
Delete all files in both those folders
Then go to MinGW ,
Take everything inside the mingw32 folder and paste it inside of the minsys mingw32 folder
Then Take everything inside the mingw64 folder and paste it inside of the minsys mingw64 folder
--
Now your minsys is ready to go.
--
Now you can update your PATHS so your computer can find and use it
--
Go to Settings > system about >> Advanced System Settings >> Enviroment Variables >> Click Path in top "User Variables for ***" Section (This will set theses PATHS only for this Computer User) >> Then click on the ADD button and paste C:\msys64\mingw64\bin
--
Important Note: After you entered in your PATHS in the Enviroment variables you should click TWO ok buttons, to Activate the edits.
So Click ok.
When that pop up closes that you entered in your path make sure to click OK AGAIN on the Original Enviroment Variables page, so that you finally set your new changes.
If you do not do this your changes will not be actually saved.
then you can open CMD ( if you already have it open make sure to close it first and then open it again fresh)
Then Type
gcc --version
Then
g++ --version
Then
gdb --version
if they all say there is a version installed you are good to go!
--
This fixed it for me, You can do it!
--
Additional link Help
Thanks!
Upvotes: -1
Reputation: 31
Upvotes: 0
Reputation: 121
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
Upvotes: 5
Reputation: 149
You have to modify environment variables. Do the following:
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
Upvotes: 13
Reputation: 1074
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
Upvotes: 16