[Haskell-cafe] ffi linking problem

Stefan O'Rear stefanor at cox.net
Tue May 29 23:55:23 EDT 2007


On Tue, May 29, 2007 at 11:48:18PM -0400, jeff p wrote:
> Hello,
> 
>  Thanks for the tips. I've gotten to the point where linking fails on
> an undefined reference. The strange thing about this is that when I
> make a C program to call the library function and compile with:
> 
>    myPrompt> gcc f.c mylib.lib
> 
> everything works fine. I think ghc is using it's own version of gcc
> and ld which aren't happy about my library. Does this seem possible?

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. 

Stefan


More information about the Haskell-Cafe mailing list