Console application in MinGW
|Reported by:||SF/vakons||Owned by:||Kirben|
Currently, even if ScummVM was compiled under MinGW with "--enable-console" switch, it is still a regular GUI application without console window.
To show debug messages etc., even when already started from console, it calls AllocConsole() and creates additional window, but when the application terminates, this window closes too.
As a result, you can't see errors, or even help text when starting with "--help" switch.
The suggestion is to link a "console application with GUI" when "--enable-console" is used. It will allow to keep all messages when ScummVM is started from Windows console.
To do this, 2 switches should be passed to linker: "-mwindows" and "-mconsole". The "-mwindows" is already applied in "sdl-config", so here's the remaining one.
Was (line 2152 of "configure" script): LIBS="$LIBS -lmingw32 -lwinmm -lgdi32" OBJS="$OBJS scummvmwinres.o"
Change to: LIBS="$LIBS -lmingw32 -lwinmm -lgdi32" if test "$_text_console" = yes ; then LIBS="$LIBS -mconsole" fi OBJS="$OBJS scummvmwinres.o"
Patched script attached (from 1.6.0git-1890-g78464a4, https://github.com/scummvm/scummvm/tree/78464a42d78091ac1b54c6ae18c3a67d90fb59bf). md5: 507b6a9a6fce5cc2babc35bf818cc94a
P.S. Sorry for not making regular *.patch - I'm not sure what program I should use for that.
Ticket imported from: #3575582. Ticket imported from: patches/1566.