
Thanks Mark!
It works also here, and even without the "-fpic" flag. Was it necessary for
you?
2012/3/8 Mark Wright
Hi Yves,
It works (on Gentoo) when I compile it as a shared library.
% g++ -o libstuff.so -fpic -shared Stuff.cpp % ghci Main.hs -L$PWD -lstuff GHCi, version 7.4.1: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... linking ... done. Loading object (dynamic) /h/argus/2/eng/haskell/cxx_stuff/libstuff.so ... done final link ... done Loading package filepath-1.3.0.0 ... linking ... done. Loading package bytestring-0.9.2.1 ... linking ... done. Loading package unix-2.5.1.0 ... linking ... done. Loading package old-locale-1.0.0.4 ... linking ... done. Loading package old-time-1.1.0.0 ... linking ... done. Loading package directory-1.1.0.2 ... linking ... done. Loading package process-1.1.0.1 ... linking ... done. Loading package goa-3.1 ... linking ... done. [1 of 1] Compiling Main ( Main.hs, interpreted ) Ok, modules loaded: Main. *Main GOA>
Hope this helps.
Regards, Mark