[Haskell-cafe] Re: Creating DLLs with GHC

Cyril Schmidt cschmidt at deds.nl
Wed Sep 27 03:18:25 EDT 2006


Matthew,

As regards the symbols that end with _closure, I believe you can
resolve them by adding
-package parsec
to the ghc command line (as far as I can see, all the symbols you
list come from the parsec package).

I don't know, though, what to do with the undefined symbols from
matrixstack. You can try to check two things:
1) That the options you specify with -optl really reach the linker
   (e.g. try to give a non-existent library in -optl option and see
   if it complains).
2) That matrixstack.lib is understood by the linker (that is, it
   must be created with dlltool)
3) That the symbols it is looking for do exist in matrixstack.lib
   (you can check it with objdump, for instance).

Cheers,

Cyril
___

Matthew Bromberg wrote:

>ghc --mk-dll -o netsim.dll ExternLib.o ExternLib_stub.o dllNet.o src1.o
>src1_stub.o src2.o  -optl-lmatrixstack -optl-L"."

>My external C library is in matrixstack.dll and it has a corresponding
>static link stub library matrixstack.lib in the same directory as all
>the sources. It has references in one of the sources (say src1.hs).

>Unfortunately I get a host of undefined references to basically all the
>functions in matrixstack.dll and also some undefined references of the form
>Parsefile.o:ghc2996_0.hc:(.text+0x130): undefined reference to
>`TextziParserCombinatorsziParsecziError_show_closure'



More information about the Haskell-Cafe mailing list