I'm trying to embed gambit in a Qt-based Windows application (compiled
with MinGW). The app works fine when I link to Qt as a console
application. However, when I removed the -console option from Qt and
rebuilt the app, first it died in ___device_pipe_close_raw_virt on the
CloseHandle call (around line 2710 of os_io.c). After searching the
mailing list, I figured this was because it was trying to close
stdin/stdout/stderr there. So I put in a check to see if d->h_wr was
equal to those handles. That got me past that point. Then the
application would startup, then exit without error. After debugging
it in gdb, I realized it was running the ___winmain function from
os_base.c and then exiting.
So I'm wondering -- has Gambit ever been tested to work without the
console window? I know you can hide it when calling the
process-related procedures, but I couldn't find anything in the
documentation or on the mailing list about the main app not having a
console.
The people using the application I'm writing definitely don't want a
console window popping up when it is started, so I'd really like to
get rid of it.
I suspect that I need to somehow link in libgamb.a without it having a
WinMain function (since that is the Windows application's "main"
function). Obviously, the Qt side has its own WinMain. I'm a little
surprised that there wasn't a linking error there due to multiple
WinMain functions, but I haven't investigated that yet.
Anyway, any hints anyone can give me on how to get this working would
be greatly appreciated. I'm hoping that others have done this before
and there is something simple that I've missed. Oh, btw, I'm doing
all of this using version 4.6.4.