[Qt-interest] stdout in a Visual Studio compiled GUI application
Scott Aron Bloom
Scott.Bloom at sabgroup.com
Thu Apr 30 19:46:08 CEST 2009
Relying on stdout on windows is well.. unreliable.
In a debug environment with no console, stdout gets redirected to the
debug stream. With no debug stream available, it gets tossed out.
If you don't want a console to pop up, then I recommend you have an
intermediary "stream" inside your app rather then calling stdout
directly, you write to this stream.
That stream could then write to a log file for windows or stdout for
linux
Scott
> -----Original Message-----
> From: qt-interest-bounces at trolltech.com [mailto:qt-interest-
> bounces at trolltech.com] On Behalf Of Mike Inman
> Sent: Thursday, April 30, 2009 10:40 AM
> To: qt-interest at trolltech.com
> Subject: [Qt-interest] stdout in a Visual Studio compiled GUI
application
>
>
> Hi,
>
> I have a GUI app that has a little bit of self-test diagnostics built
> into it. When building/running/testing under Linux, the app is called
> repeatedly from a bash script and the diagnostics do their output to
> stdout (printf, etc.) piped to log files.
>
> I'd like to build something similar to work with the Visual Studio
2008
> compiler, called from a batch file, output piped to log files, etc.
> Unfortunately, stdout seems to be piping to a black hole unless I add
> console to the .pro file, and I don't want a console window to open
when
> the app opens (basically, I want it to function like it does under
> Linux, where the stdout will be seen _if_ the app was launched from a
> command line, and is invisible otherwise, actually, otherwise doesn't
> matter because nothing is sent to stdout if the app is functioning
> normally.)
>
> So, is there a convenient mechanism that works in both environments?
I
> could switch everything over to output to dedicated files, but that's
> not very convenient in the bash script world....
>
> Thanks,
>
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
More information about the Qt-interest-old
mailing list