[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] Win32 stdio not working if SDL is enabled
From: |
Pavel Fedin |
Subject: |
Re: [Qemu-devel] Win32 stdio not working if SDL is enabled |
Date: |
Thu, 13 Aug 2015 15:14:24 +0300 |
Hello!
> 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.
Just a hint which may have to do with this. Looks like SDL introduces its own
entry point, but it's WinMain() instead of main(). In this case standard CRT
setup is omitted. But it is very easy to recover in this case. Just call:
freopen("CONOUT$", "w", stderr);
This performs the necessary setup and relinks CRT's stderr with Windows
console stream. It is a well known hack.
More info here:
http://stackoverflow.com/questions/9020790/using-stdin-with-an-allocconsole
Kind regards,
Pavel Fedin
Expert Engineer
Samsung Electronics Research center Russia