[Haskell-cafe] GHCi fails to load C++ object files (missing symbol)

Mark Wright markwright at internode.on.net
Thu Mar 8 09:33:48 CET 2012


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



More information about the Haskell-Cafe mailing list