On Wed, May 14, 2008 at 5:46 PM, Bulat Ziganshin <bulat.ziganshin@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.