13 Jun
2001
13 Jun
'01
9:46 p.m.
You need to use H/Direct 0.17, which unfortunately you have to compile from source. 0.16 (which I presume you're using) doesn't work with GHC 4.08.2. I checked your example against the CVS HEAD version of H/Direct, and it worked fine, except that I had to make the following changes (to correct unintentional errors, I presume): [incr.c] + #include <windows.h> - BOOL WINAPI DllMain(args...) { return TRUE; } + BOOL WINAPI DllMain(args) { return TRUE; } int __declspec(dllexport) incr(int x) { return x + 1; } [incr.idl] module Incr { [pure]int incr([in]int); } [Main.hs] module Main(main) where + import Incr main = print (incr 2)