10.3. Creating a DLL

Sealing up your Haskell library inside a DLL is quite straightforward; compile up the object files that make up the library, and then build the DLL by issuing the following command:

sh$ ghc --mk-dll -o HSsuper.dll A.o Super.o B.o libmine.a -lgdi32

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.

A couple of things to notice: