[Haskell-cafe] FFI, C/C++ and undefined references

Bulat Ziganshin bulat.ziganshin at gmail.com
Thu Jan 14 15:33:07 EST 2010

Hello Daniel,

Thursday, January 14, 2010, 11:08:24 PM, you wrote:

i think you are wrong. stdcall used for std windows dlls, but gcc by
default generates ccall things. and cl anyway useless here

> Just an idea. Are you on windows?
> If so, then your foreign calls would probably have to be

> foreign import stdcall "srilm.h whatever" ...

> instead of 

> foreign import ccall "..."

>> Malcolm Wallace wrote:
>> > However, if you are unsure of which Haskell packages are needed, it is
>> > wise to let ghc work out the dependencies for you, e.g. with
>> >      ghc --make Main.hs slirm.o
>> >
>> > It cannot work out the C/C++ dependencies though, so every time you
>> > get "undefined reference" linking errors, you must discover which C
>> > code provides those symbols, and add its object file to the
>> > commandline by hand.

> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe

Best regards,
 Bulat                            mailto:Bulat.Ziganshin at gmail.com

More information about the Haskell-Cafe mailing list