[Haskell-cafe] ffi linking problem

jeff p mutjida at gmail.com
Wed May 30 00:28:43 EDT 2007


Hello,

> No, but ghc does pass a lot of funny flags...
>
> Double check ccall v. stdcall in the import declaration.  That bites a
> lot of people on Windows.
>
My import statement originally looked like:

    foreign import ccall "mylib.h myFun" my_fun :: CDouble -> IO (Ptr CDouble)

and my original linker error was an undefined reference to 'myFun'.

Changing the import statement to:

    foreign import stdcall "mylib.h myFun" my_fun :: CDouble -> IO (Ptr CDouble)

results in the linker complaining about undefined reference to 'myFun at 24'.

I also tried throwing in "static" but it seems to have no effect.

thanks,
  Jeff


More information about the Haskell-Cafe mailing list