Hi Jason,

On 8 March 2011 05:28, Jason Dusek <jason.du...@gmail.com> wrote:
>    gcc -g -Wall -O2 -fPIC -Wall -o import \
>      -I/usr/lib/ghc-6.12.1/include/ \
>      import.c exports.so

In my experience, the easiest way to do this is to use gcc to build
object files from C source files, and then specify those object files
on the ghc command line in order to get GHC to do the linking step.
This will deal with linking in the correct RTS and, if you specify
appropriate -package flags, dependent packages as well.

If you want a C main function then see user guide section 8.2.1.1 at
http://www.haskell.org/ghc/docs/latest/html/users_guide/ffi-ghc.html.

Cheers,
Max

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to