foreign funciton invokation

Chen Yu chenyu888@hotmail.com
Sun, 23 Sep 2001 05:23:42 +0000


<html><div style='background-color:'><DIV>
<DIV>
<DIV>hi, there,</DIV>
<DIV>&nbsp;&nbsp;&nbsp; can someone check what's wrong with the following code?</DIV>
<DIV>as well, do i need to tell ghc to look for libcdata.so under /usr/local/lib </DIV>
<DIV>&nbsp;</DIV>
<DIV>source:</DIV>
<DIV>-------------</DIV>
<DIV>module Main where<BR><BR>foreign import "cdata" "ghc_cd_int_init" cd_int_init :: Int32 -&gt; ForeignPtr<BR><BR>main = do<BR>&nbsp;&nbsp;&nbsp; c &lt;-ghc_int_init(23)<BR></DIV>
<DIV>&nbsp;</DIV>
<DIV>compiling error<BR>--------------------<BR>ghc --make Main.hs -o test -package data&nbsp; -ltermcap<BR>ghc-5.00.2: chasing modules from: Main.hs<BR>Compiling Main&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ( Main.hs, ./Main.o )<BR>Main.hs:3: parse error on input `import'<BR></DIV></DIV></DIV></div><br clear=all><hr>Get your FREE download of MSN Explorer at <a href='http://go.msn.com/bql/hmtag_itl_EN.asp'>http://explorer.msn.com</a><br></html>