c++ - Why doesn't Qt send debug message to std error stream in Windows? -


this question has answer here:

i use qdebug() in eclipse in windows, doesn't give me output, seems qt sends debugger qt's documents below.

the qt implementation of these functions prints text stderr output under unix/x11 , mac os x. windows, if console application, text sent console; otherwise, sent debugger. 

my purpose not how print message in eclipse in windows.

my purpose know why qt doesn't choose send debug message std error stream in windows, while sends debug message std error stream in mac os.

is there differences between windows , mac os?

thanks help.

since question "why" , not "how", reason twofold:

  • gui programs under windows don't have console, have open (and release versions of course won't, that'd annoy users). don't inherit console of process starts them. qt gui programs want behave other gui programs under windows, unless explicitly specify otherwise (for example adding config+=console qmake).

  • debug output in windows done using debug output feature of windows (some practical info here in download page of debugview tool), example every windows ide supports it. qt follows platform convention software development.

in short, that's how it's done under windows default , convention. if qt did different, then necessary have reasons why.

the default behavior different under unix (and linux), child process inherits stdin, stdout , stderr tty of parent, unless measures taken. , no special measures taken programs themselves, it's parent (for example adding 2>/dev/null when starting program shell/script).

note: did not have time check if debug builds of qt apps under windows behave bit differently , default output console, take account when reading above.


Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -