writing to stdout in an windows app without a console

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Wed Feb 16 13:29:08 EST 2005

On Wed, 2005-02-16 at 14:49 +0000, Simon Marlow wrote:
> On 16 February 2005 14:06, Duncan Coutts wrote:
> > On Wed, 2005-02-16 at 14:31 +0200, Krasimir Angelov wrote:
> >> On Wed, 16 Feb 2005 12:01:06 +0000, Duncan Coutts
> >> <duncan.coutts at worc.ox.ac.uk> wrote:
> >>> What's your opinion of making writing to stdout fail without
> >>> raising an exception when the application is compiled with
> >>> --subsystem windows?

> I've seen this behaviour vary between versions of Windows (maybe even
> between versions of msvcrt, MS's C library).  A strange experience we
> had with the Visual Studio extension was that I was initially just doing
> output to stderr from the DLL for debugging, which worked fine on my
> machine but crashed on other people's machines.  We had to remove all
> uses of stdout/stderr from the Haskell DLL (including the runtime!) to
> get it going reliably.

Ok, fair enough. It sounds like with the improvements in ghc 6.4 we'll
be able to turn the --subsystem windows on by default for gtk2hs when
using ghc 6.4, though we'll still have to warn people not to use normal
output functions.

[and we'll have to fix all our demos! :-) ]


More information about the Glasgow-haskell-users mailing list