I'm compiling a GUI application, and have set the SubSystem to /SUBSYSTEM:WINDOWS. This has the normal behavior of not opening a command shell when the application is launched by double clicking it. However, what I would like is this: when the application is launched from a command shell (cmd -> cd to the exe directory -> type exe name), I would like write(*,*) statements in the code to show up in the shell. Currently, of course, they do not appear. Basically, I want to build one executable that can be used as a normal application, but also has a command-line mode when launched from a DOS shell. Is such a thing even possible?
For more complete information about compiler optimizations, see our Optimization Notice.