

Just for the fun of it, I tried installing MinGW and compiling the program with that instead, and it works like a charm on both cases.

Running it on the Cygwin shell prints x 0, and running on CMD prints just the exit status 127, so it seems to be something with how the compiler is building the system-dependent bits of the code. run.exeįortran runtime error: EXECUTE_COMMAND_LINE: Invalid command lineįor the younger generations, who don't use Fortran, this C program shows the same issue: #include What's going on?īuilding it with gfortran -o run test.f95 then executing gives, on the Cygwin shell: $. What I'm guessing is that the shell used by execute_command_line to run the command line is not the same I'm using by hand (even though the documentation says it runs on cmd.exe, which then just adds to my confusion). What really intrigues me is that if I run (what I believe to be) the exact same command manually: D:\test>echo ab What puzzles me is not the fact that it doesn't work (it's Windows, after all :).

Which seems to be an error from the shell(?) saying Invalid command line. However, when I run the very same executable from CMD or PowerShell, it gives: D:\test>run.exe ( i.e.: anb is printed, the exit status is zero, and the return message is blank). When I run it from the Cygwin Terminal, it works as I'd expect: $. I build it with simply gfortran -o run file.f95, then execute it from the command line.
Point measure command not working invalid windows#
I'm on Windows with Cygwin with gcc 11.2.0, and my problem boils down to this Fortran code: program testĬall execute_command_line("echo ab",cmdstat=stat,exitstat=ext,cmdmsg=err)
