Were there any warnings in the command prompt window?
'g++' is not recognized as an internal or external command,
operable program or batch file.
Means that your compiler is not on the path.
First ensure mingw\bin is in your path
path C:\mingw\bin;%path%
I forgot to mention that
C:\mingw\bin must (of course) point to your compiler's installation directory; on my computer, for example, it is
C:\libraries\mingw, so I would type
path C:\libraries\mingw\bin;%path%g++: main.cpp: No such file or directory
Means that you are in the wrong folder; type
G:to switch to the G: drive, and
cd \to ensure you are in the root of the drive. Then your type
g++ main.cpp -o main.exeto compile. The resulting line should look like
G:\>g++ main.cpp -o main.exe
If there are no errors, it will produce
main.exe (but it will not show any messages).