foreign funciton invokation

Chen Yu
Sun, 23 Sep 2001 05:23:44 +0000

<html><div style='background-color:'><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 under /usr/local/lib </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>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=''></a><br></html>