GHC and Windows (DLL/FFI) woes

Esa Ilari Vuokko eivuokko at
Sun Oct 23 14:00:25 EDT 2005


I have been trying to build some Windows DLLs with
GHC, and I have run into some misfeatures or maybe
I have misunderstood how to use GHC.  Any help or
advice would be appreciated. :)

First of all, I can't get ghc to generate stubs from
foreign export in anywhere else than next to original
source, which is sort of annoying.  I would like all
the generated files to go quite a bit diffrent place than
source directory.

Next, --make and --mk-dll don't seem to work together.
Ok, what I do, is I just --make -no-link and then --mk-dll
all the object files I find :)

It seems that -i flag and compiling those _stub.c have
following problem:  if path given in -i flag contains any
/- or \-characters, i.e. any real subpaths, it seems to
stop with something like:
createDirectory: invalid argument (Invalid argument)
It seems a bit random what is the supposed "filename"
part of the path, typically it contains drive letter and few
colons, it doesn't seem totally random data.

--Esa Ilari Vuokko

More information about the Glasgow-haskell-users mailing list