[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] Win32 stdio not working if SDL is enabled
From: |
Stefan Weil |
Subject: |
Re: [Qemu-devel] Win32 stdio not working if SDL is enabled |
Date: |
Thu, 13 Aug 2015 19:48:47 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.8.0 |
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 <address@hidden>
> 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