10.3. Creating a DLL

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:

ghc --mk-dll -o foo.dll bar.o baz.o wibble.a -lfooble

By feeding the ghc compiler driver the option --mk-dll, it 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.

To create a `static' DLL, i.e. one that does not depend on the GHC DLLs, use the -static when compiling up your Haskell code and building the DLL.

A couple of things to notice: