[Haskell-cafe] Creating DLLs with GHC

Jason Dagit dagit at eecs.oregonstate.edu
Wed Sep 27 17:18:10 EDT 2006

On 9/27/06, SevenThunders <mattcbro at earthlink.net> wrote:

> Does cabal really work on windows?

I've never had a problem with cabal on windows.  I use it instead of
makefiles and I'm reasonably happy with it.

> Although it's installed I notice that
> when I try to build my library using it, it dies on the first foreign import
> statement in the first .hs source it tries to compile. It is reminiscent of
> trying to import a foreign C module directly ghci.  ghc.exe, on the other
> hand has no problem with it.

Perhaps your .cabal file is not correct or your cabal version is too
old?  It's very hard to say without detailed error messages and a
clear description of what you're doing (with sample code).

> Does this scheme address the problem of being unable to link external C
> libraries (a DLL) into the Haskell DLL?  Are there any other workarounds
> here?

I only create a DLL from haskell and link that in a C++ application.
I haven't tried the other way.  Probably over the next month or so the
DLL I'm creating in Haskell will need to access an existing DLL.
Hopefully this will work fine.

> Is it possible to create static link libraries compatible with MS
> VC++?  Ultimately I'm trying to link my C code with Matlab.  The C code stub
> will then call a bunch of Haskell routines.

I have no idea.  I'm fairly new to using Haskell in windows.


More information about the Haskell-Cafe mailing list