1

I use the Min-GW GCC compiler on Windows 10. Every time I compile, I need to make a .exe and then run it. Could there be any way to do the whole thing in one step?

  • `gcc file.c -o file.exe&&./file`? Alternatively, tcc can run C, too – JCWasmx86 Sep 11 '20 at 14:41
  • 1
    Learning Make or just writing a small C program that sends shell commands using `system()` in `stdlib.h` to compile as well as execute ! – A P Jo Sep 11 '20 at 14:42
  • This question may not be very on-topic ... – A P Jo Sep 11 '20 at 14:43
  • Get some [IDE](https://en.wikipedia.org/wiki/Integrated_development_environment), there are many of them. – Jabberwocky Sep 11 '20 at 14:46
  • `&&` only works in PS7 and cmd prompt. [Here's how to `&&` in powershell](https://stackoverflow.com/a/564092/6243352) -- or use a script, use make or the other options suggested here. – ggorlen Sep 11 '20 at 14:49

1 Answers1

1

You can combine commands in windows like you do on linux or macos!

gcc compilefile && c:/executefile.exe

(you need to replace that stuff with min-gw and your exe path)

links: