#include<iostream>
using namespace std;
int main()
{
cout<<"hi"<<endl;
return 0;
}
I am using Sublime text 3, and I am getting this error:
error- 'g++' is not recognized as an internal or external command, operable program or batch file. [Finished in 0.0s]
You need to set the environment PATH to include the directory of mingw's bin directory if you want o use gcc.exe or g++.exe in cmd . run 'path' or 'echo %PATH% in cmd.exe prompt. Check the path carefully.
If you don't see the expected output or g++ or gdb is not a recognized command, make sure your PATH entry matches the Mingw-w64 binary location where the compilers are located. If the compilers do not exist at that PATH entry, make sure you followed the instructions on the MSYS2 website to install Mingw-w64.
Try to set g++
to your system path.
You can refer to this: http://stephencoakley.com/2015/01/21/guide-setting-up-a-simple-c-development-environment-on-windows
I faced the same problem while running the code from command line. And found out that I messed up with MinGW installation. So I reinstalled it,
Do this while installing MinGW ----
when it is done, then edit the environment 'Path' Variable as stated in other answer.
In short I followed this
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With