building an entire Haskell application as a single DLL is still supported: it's
just multi-DLL Haskell programs that don't work. The Windows
distribution of GHC contains static libraries only.</emphasis></para>
building an entire Haskell application as a single DLL is still supported: it's
just multi-DLL Haskell programs that don't work. The Windows
distribution of GHC contains static libraries only.</emphasis></para>
Sealing up your Haskell library inside a DLL is straightforward;
compile up the object files that make up the library, and then build
the DLL by issuing a command of the form:
Sealing up your Haskell library inside a DLL is straightforward;
compile up the object files that make up the library, and then build
the DLL by issuing a command of the form:
will build a DLL rather than produce an executable. The DLL will
consist of all the object files and archives given on the command
line.
will build a DLL rather than produce an executable. The DLL will
consist of all the object files and archives given on the command
line.
this, you can specify the <emphasis>module definition file</emphasis> to use
on the command line as follows:
<screen>
this, you can specify the <emphasis>module definition file</emphasis> to use
on the command line as follows:
<screen>
creates an import library. The import library name is derived from the
name of the DLL, as follows:
<programlisting>
creates an import library. The import library name is derived from the
name of the DLL, as follows:
<programlisting>
</programlisting>
The naming scheme may look a bit weird, but it has the purpose of allowing
the co-existence of import libraries with ordinary static libraries (e.g.,
<filename>libHSfoo.a</filename> and
</programlisting>
The naming scheme may look a bit weird, but it has the purpose of allowing
the co-existence of import libraries with ordinary static libraries (e.g.,
<filename>libHSfoo.a</filename> and
Additionally, when the compiler driver is linking in non-static mode, it
will rewrite occurrence of <option>-lHSfoo</option> on the command line to
Additionally, when the compiler driver is linking in non-static mode, it
will rewrite occurrence of <option>-lHSfoo</option> on the command line to
non-static to static linking is simply a question of adding
<option>-static</option> to your command line.
non-static to static linking is simply a question of adding
<option>-static</option> to your command line.