[project @ 2005-02-24 08:59:36 by simonpj]
authorsimonpj <unknown>
Thu, 24 Feb 2005 08:59:36 +0000 (08:59 +0000)
committersimonpj <unknown>
Thu, 24 Feb 2005 08:59:36 +0000 (08:59 +0000)
Add a clarifying para about Win32 GUI-only programs

ghc/docs/users_guide/win32-dlls.xml

index 0b8d159..45d75d1 100644 (file)
@@ -45,6 +45,16 @@ If you want to build a GUI-only application, with no console window, use the fla
 <literal>-optl-mwindows</literal> in the link step.
 </para>
 
+<para>       <emphasis>Warning:</emphasis> Windows GUI-only programs have no
+        stdin, stdout or stderr so using the ordinary Haskell
+        input/output functions will cause your program to fail with an
+        IO exception, such as:
+<screen>
+      Fail: &lt;stdout&gt;: hPutChar: failed (Bad file descriptor)
+</screen>
+        However using Debug.Trace.trace is alright because it uses
+        Windows debugging output support rather than stderr.</para>
+
 <para>For some reason, Mingw ships with the <literal>readline</literal> library,
 but not with the <literal>readline</literal> headers. As a result, GHC (like Hugs) does not
 use <literal>readline</literal> for interactive input on Windows.