[hatari-devel] Console I/O on Windows

Eero Tamminen oak at helsinkinet.fi
Tue Jan 4 20:13:30 CET 2011


Hi,

On perjantai 31 joulukuu 2010, Vincent Rivière wrote:
> I use the official Hatari 1.4.0 on Windows.
> 
> When Hatari starts, it opens a console window, but it is useless because
> it always remains empty. Debug output and debugger are unusable.
> 
> It seems that Hatari is compiled as a graphical application (versus
> console), then the console is opened afterwards. Unfortunately this does
> not work, stdio and stderr are not routed to that console.
> 
> Instead, when compiled with GCC, Hatari should be linked with
> "--subsystem console" so the console will be automatically opened at
> startup and everything will be fine.

AFAIK Nicolas built the Windows version (using Linux cross-compiler for
Hatari Windows binaries).


I found an earlier mail about the Windows build with a comment on similar 
issue:
-------------
On February 28th 2010, Thomas Huth wrote:
> On Sun, 28 Feb 2010 13:26:10 +0100 (CET) npomarede at corp.free.fr wrote:
>>   - pressing alt+pause doesn't enter the debug mode but just pause 
>>    hatari. do we need a console or something else to enable it ?
> 
> There is some special code in src/gui-win/opencon.c for opening a new
> console window. It's not compiled into the Hatari executable on windows
> yet, someone got to translate the Makefile there into a CMakeLists.txt
> first (I could do this "blindly", but I do not have any possibility for
> testing this anymore, so I'd prefer if someone else could do this step).
-------------

opencon.c states:
"The SDL library redirects the stdio normally to the files stdout.txt and
  stderr.txt. But with this redirection, the debugger of Hatari does not
  work anymore.  So we simply open a new console when the debug mode has
  been enabled, and we redirect the stdio again - this time to our new
  console."

So, now I wonder whether these comments are specific to MS C/C++ compiler
and would "--subsystem console" work also with that...?


> I have used a hack tool to change the subsystem of the official
> hatari.exe to console and it works fine.


	- Eero



More information about the hatari-devel mailing list