Visual Studio 2010 C ++ does not display console output, despite setting up the console subsystem

I have a project that creates a console application as part of a larger solution, but it does not display anything on the console. I checked that /SUBSYSTEM:CONSOLE set for both debugging and release, and tried both std::cout and printf , no output should be displayed.

The entire VS solution consists of several static libraries containing the basic business code, and three executable files - the main GUI (QT/OpenGL) , unit test (boost), and this is a console application. Some library classes use Qt (mainly for signals / slots). Both the GUI and Unit tests behave as expected (which in the case of tests involves writing to the console output).

I also tried to add an AllocConsole call at the beginning of the main function - this will bring up a console window, but nothing has been written so far - and yes, I checked that the code calls cout !

What else could be wrong? Is there another setting somewhere? or Qt redirect stdout without telling me?

+5
source share
1 answer

It turned out that Visual Studio moved the / SUBSYSTEM: CONSOLE option with / SUBSYSTEM: WINDOWS on the Linker-> Command Line-> Additional Options page - removing this showed that it was working correctly ...

+7
source

Source: https://habr.com/ru/post/1208833/


All Articles