I have a Qt application in Visual Studio 2005 which is linked using \subsystem:windows
such that when I run the compiled executable it does not create a command line terminal, as well.
I would like to create a command-line mode: when I start it with the --nogui
command line argument, then the GUI is not presented, but a simple command-line program is run. Since the linking uses /subsystem:windows
, the command line mode doesn't show any of the std::cout
outputs unless I link my executable with \subsystem:console
.
Is there a way to set the compilation/linking such that the same executable can either present the GUI windows or behave as a console application based on command-line parameters?
PS. I use Qt 4.2.0 and Visual Studio 2005 and the project is in C++.