[Haskell-cafe] FFI, C/C++ and undefined references
dnmehay at gmail.com
Thu Jan 14 15:39:57 EST 2010
Nope. Ubuntu Linux (Intrepid Ibex). I wish it were that simple.
Daniel Fischer-4 wrote:
> Am Donnerstag 14 Januar 2010 20:42:42 schrieb DNM:
>> Which is weird, because 'srilm.o'/'srilm.h' are the files that define
>> the mysterious "undefined references". I'll keep plugging away and
>> report back when (or whether) I make some progress. In the meanwhile,
>> if anyone has a clue, I'm all ears.
> 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
View this message in context: http://old.nabble.com/FFI%2C-C-C%2B%2B-and-undefined-references-tp27139612p27167751.html
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.
More information about the Haskell-Cafe