0

A Visual Studio C++ application, I'd like stdout to go the the console when the application is started from the console, but I'd like the application to not open a console window when started by double-click (and I'm happy to not see the stdout). How can this be done?

Using the Properties/Linker/System/SubSystem option to specify /SUBSYSTEM:CONSOLE gives the desired behaviour when the application is started from the command line; using /SUBSYSTEM:WINDOWS gives the desired behaviour when the application is started with double-click. Neither option gives the desired behaviour for both ways of starting the application.

Captain Normal
  • 441
  • 4
  • 14
  • See also Raymond Chen's [How do I write a program that can be run either as a console or a GUI application?](https://devblogs.microsoft.com/oldnewthing/20090101-00/?p=19643) and the (fixed) [link](https://learn.microsoft.com/en-us/archive/msdn-magazine/2004/february/c-q-a-color-support-console-apps-and-saving-user-settings) therein. – dxiv Jan 26 '21 at 16:24
  • 1
    Yes, the first answer you referred to was what I was searching for. And I did indeed search for it but somehow the keywords I was using did not find it. (I hope my question here will help someone's search in the future.) – Captain Normal Jan 27 '21 at 15:05

0 Answers0