0

I followed this link to set up MinGW on my Windows computer: https://www.cs.odu.edu/~zeil/cs250PreTest/latest/Public/installingACompiler/#installing-the-cygwin-compiler. When I enter "g++ --version", "gdb --version", and "mingw32-make --version" it all works. I set my PATH variable to "C:/MinGW/bin". When I run "g++ -file.cpp -o file" it compiles, but when I run "./file" I get the error "'.' is not recognized as an internal or external command, operable program or batch file."

I tried doing "... -o file.exe" and trying to run it by entering "file" or "file.exe", that doesn't work.

Marie
  • 1
  • The `./` part is a POSIX shell thing, it's not needed on Windows. – Some programmer dude Sep 07 '19 at 16:32
  • Wait a sec. I just noticed the cygwin bit. If you're running the program in a cygwin terminal, ./file would be the correct way to run the program. – user4581301 Sep 07 '19 at 16:33
  • Since the linked document describes setting up compilers with both cygwin (a POSIX environment for Windows. Programs built require cygwin to run) and mingw (compiles native windows applications. No cygwin required), which did you install? Both shouldn't be a problem, but in that case you need to know which tool you're using. May I suggest [simplifying your life a little with msys](https://stackoverflow.com/a/30071634/4581301)? – user4581301 Sep 07 '19 at 16:41
  • I tried running just "file" and I get a Windows Script Host popup that says "Script: \file.js Line: 1 Char: 1 Error: 'process' is undefined Code: 800A1391 Source: Microsoft JScript runtime error" – Marie Sep 07 '19 at 16:43
  • In my original question I said I installed MinGW – Marie Sep 07 '19 at 16:44

0 Answers0