-5

I make a program in C++ using Notepad++, and then I'm trying to compile it in cmd using g++ -o gt struct1.cpp

But, there's this sentence shown in cmd:

'g++' is not recognized as an internal or external command, operable program or batch file.

What must I do so I can compile and run the program?

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
k.k
  • 9
  • 1
  • 1
    You probably, probably, need this: http://www.mingw.org/wiki/Getting_Started But this is way too broad a question to ask here. – Joe Oct 25 '17 at 07:42
  • 3
    "_I'm running it_" From the command that you wrote - you are not running it, you are trying to compile it. "_g++' is not recognized as an internal or external command, operable program or batch file._" Do you have g++ installed? – Algirdas Preidžius Oct 25 '17 at 07:43
  • You need to install and set up a compiler. You can either install Visual Studio, mingw add the path to your system path or use Ubuntu Bash for Windows 10 for your first steps. There you have to do the same but I think it's easier with package manager: https://www.howtogeek.com/249966/how-to-install-and-use-the-linux-bash-shell-on-windows-10/ – Thomas Sablik Oct 25 '17 at 07:58
  • 1
    Possible duplicate of ['g++' is not recognized as an internal or external command, operable program or batch file](https://stackoverflow.com/questions/38652211/g-is-not-recognized-as-an-internal-or-external-command-operable-program-or) – Alessandro Da Rugna Oct 25 '17 at 08:09

1 Answers1

-4

If you're running windows then make use of this:

g++ -o program program.cpp

You can check this question Run C++ in command prompt - Windows

windows 10 "'g++' is not recognized as an internal or external command

You can check this

'g++' is not recognized as an internal or external command, operable program or batch file

John Joe
  • 12,412
  • 16
  • 70
  • 135