haskell-cafe@haskell.org
[Top] [All Lists]

Re: [Haskell-cafe] FFI: newbie linking problem

Subject: Re: [Haskell-cafe] FFI: newbie linking problem
From: "Olivier Boudry"
Date: Wed, 14 May 2008 19:08:35 -0400
On Wed, May 14, 2008 at 5:46 PM, Bulat Ziganshin <bulat.ziganshin@xxxxxxxxx> 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.
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@xxxxxxxxxxx
http://www.haskell.org/mailman/listinfo/haskell-cafe
<Prev in Thread] Current Thread [Next in Thread>