Am 13.08.2015 um 14:06 schrieb Daniel P. Berrange: > When debugging some patches on Windows, I discovered that nothing printed > to stderr ever appears on the console. Eventually I discovered that if I > build with --disable-sdl, then stderr appears just fine. > > Looking at the code in vl.c I see a hack for SDL introduced in > > commit 59a36a2f6728081050afc6ec97d0018467999f79 > Author: Stefan Weil <w...@mail.berlios.de> > Date: Thu Jun 18 20:11:03 2009 +0200 > > Win32: Fix compilation with SDL. > > > If I mostly kill the hack from vl.c, and just leave a plain '#undef main' > then I get working console stderr once again. >
Hi Daniel, that's a feature of SDL 1.2: stdout and stderr are by default redirected to files stdout.txt and stderr.txt in the executable's directory. This redirection can be disabled by an environment variable (SDL_STDIO_REDIRECT="no"). On my Linux machines, I always set this variable, so when I run QEMU for Windows with wine32 or wine64, stdout and stderr work. Printing to stdout / stderr on Windows can be an adventure: depending on your shell (command.exe, cmd.exe, MinGW shell, MinGW rxvt, Cygwin shell, ...) it works different, and I also had application crashes when a GUI application which was not started from a shell tried to print to stdout. >From a user's point of view, maybe a better solution than the current one would be a GTK console window which displays any output to stdout / stderr. Regards Stefan