Hi,
[Sorry I failed to attach the program in a previous mail message.]
I have tried to compile the attached program with ghc-2.07 as follows
ghc -syslib ghc test.hs
with the result
Module version unchanged at 1
Undefined first referenced
symbol in file
PackedString_unpackCString_closure test.o
ld: fatal: Symbol referencing errors. No output written to a.out
Am I doing anything wrong? Does anyone have a better suggestion for
interfacing C procedures that return (char *) strings.
Cheers,
Chris Dornan [EMAIL PROTECTED]
University College Cork +353 21 903165
-- test.hs -------------------------
import PackedString
import Foreign
unpack :: IO Addr -> IO String
unpack m =
do s <- map unpackCString m;
case length s of
0 -> return s
_ -> return s
main :: IO ()
main = putStrLn "hello world\n"