I've got a project that creates a console application, as part of a larger solution, however it won't display anything on the console. I've checked that /SUBSYSTEM:CONSOLE
is set for both debug and release, and tried both std::cout
and printf
, neither cause any output to be displayed.
The whole VS solution consists of a couple of static libraries containing the underlying business code, and three executable - the main GUI (QT/OpenGL)
, the unit tests (boost), and this console app. Some of the library classes use Qt
(mainly for signals/slots). Both the GUI and the Unit tests behave as expected (which, in the case of the tests, includes writing to console output ).
I've also tried adding a call to AllocConsole
at the start of the main function - this causes a console window to appear, but there is still nothing being written - and yes, I have checked that the code is calling cout
!
What else could be wrong? Is there another setting somewhere? or is Qt
redirecting stdout
without telling me?
It turned out that Visual Studio was over-riding the /SUBSYSTEM:CONSOLE setting with a /SUBSYSTEM:WINDOWS one in the Linker->Command Line->Additional Options page - deleting this made it work correctly...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With