-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Here is a copy of all the files I am using to try to export a Haskell
function.
This compiles but produces a executable that simply hangs.
Tom
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)
iD8DBQE/KUHbYha8TWXIQwoRAs8RAKCIFcnH9uuqfMpDYXA0gfFjBtMfEwCgjZeD
5dkfLbz/lz4btmsR9G4kL2A=
=pCBN
-----END PGP SIGNATURE-----
ghc -ffi -fvia-c -c Hello.hs
ar -rc libhello.a Hello.o Hello_stub.o
ghc -L. -lhello -I. -I/usr/lib/ghc-6.0/include -o helloworld integrate.c
module Hello where
foreign export "hello" hello :: IO ()
hello :: IO ()
hello = do putStrLn "Hello world!"
#include <Hello_stub.h>
#include <HsFFI.h>
#include <stdio.h>
int main(){
printf( "Hello there." );
hello();
exit( 0 );
}