[Haskell-cafe] FFI: newbie linking problem

Olivier Boudry olivier.boudry at gmail.com
Wed May 14 19:08:35 EDT 2008


On Wed, May 14, 2008 at 5:46 PM, Bulat Ziganshin <bulat.ziganshin at gmail.com>
wrote:

> use stdcall instead of ccall in Haskell too. afair, depending on
> calling conventions, different prefixes/suffixes are used when
> translating C function name into assembler (dll) name
>

Oops, sorry I copied the wrong line in my e-mail. I'm using stdcall in the
foreign import. I first tried with ccall and then realized the header was
defining the stdcall convention when built on windows. The link error occurs
when I use stdcall. When I use ccall it links but gives segmentation faults
when I run the program.

Here is the last import I used.
foreign import stdcall unsafe "sapnwrfc.h RfcUTF8ToSAPUC"
  f_RfcUTF8ToSAPUC :: RfcBytePtr -> CUInt -> SapUCPtr -> Ptr CUInt -> Ptr
CUInt -> RfcErrorInfoPtr -> IO RfcRetCodeType

Thanks,

Olivier.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20080514/defc0fa1/attachment.htm


More information about the Haskell-Cafe mailing list