Greetings

I am trying to import some functions from a windows DLL. I am getting
strange errors. (This used to work with previous versions of GHC.  6.6
I think.).

This is my import statement:

foreign import stdcall  "ace.h AdsConnect" adsConnect' :: CString ->
Ptr CInt -> IO CInt

This is the build output.

C:\moonar>\bin\make.exe
ghc --make -ffi main.hs  -ffi adsapi.hs -optc -DWIN32 native.cpp  -lace32 -L/hom
e/pjdurai/dev/moonar  -L/tmp/Advantage -o moonar.exe
[1 of 2] Compiling AdsApi           ( adsapi.hs, adsapi.o )
[2 of 2] Compiling Main             ( main.hs, main.o )
Linking moonar.exe ...

adsapi.o(.text+0x124):fake: undefined reference to [EMAIL PROTECTED]'
adsapi.o(.text+0x260):fake: undefined reference to [EMAIL PROTECTED]'
collect2: ld returned 1 exit status
make: *** [main.exe] Error 1

It actually links without errors if I use 'ccall' instead of
'stdcall'. But the executable segfaults when the function is called.

I had the same code working with 'stdcall' declaration a while ago.
(With GCH 6.6 I think)

I am using ghc-6.8.3 on Windows XP SP2.

appreciate your time.
thanks
pj
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to