[Haskell-cafe] Cabal, GHC, FFI and Visual Studio on Windows

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Sat Feb 2 14:06:41 EST 2008

On Sat, 2008-02-02 at 18:50 +0000, Magnus Therning wrote:
> Duncan Coutts wrote:
> [..]
> > It would be reasonable to use the system C compiler rather than ghc,
> > however we will have to do more work to find what extra include dirs get
> > used and have Cabal pass those.
> > 
> > Currently we pass the -package flags to ghc which ghc uses to look up
> > what include dirs those packages add, and then it calls the C compiler
> > with those extra include dirs. Cabal would have to do that itself.
> Well it sounds like I'll have to settle for a two-step build procedure
> for the time being.  Luckily I managed to recall the existence of CMake
> just today, so it seems I can make my Haskell-hacking-on-Windows
> experience somewhat bearable...

Just so I'm sure I understand...

So you're building a .dll using just C code and then you want to link
that in with a Haskell prog that uses that .dll. And it is essential
that the C code be built using MS's C compiler and not gcc.

Is that right? And you'd like to have the .dll built using Cabal rather
than having to hack an external C/Makefile.

Or are you just trying to link some C code statically into a haskell
program, but it just so happens that this C code relies on being built
with MS's C compiler rather than gcc.

Perhaps you could clarify what it is you're trying to do (the end goal,
just just the minutia) so we can see what feature it is that Cabal is
missing that would help your situation. When we figure that out we can
file a feature request so it is not forgotten.


More information about the Haskell-Cafe mailing list