FFI & C++

Niklas Sörensson nik@cs.chalmers.se
Tue, 29 Oct 2002 17:43:01 +0100 (MET)


I am currently trying to create a Haskell interface to a C++ library and
cannot get it to work completely. The problem seems to be that the linker
must be able to find the code for basic C++ constructs like new and throw.
Apparently it is able to do so when compiling an executable, but when I
try to do the same with ghci it fails. Anybody have an idea why this
happens and what to do about it?

A second question,

The feature to install local packages is currently a bit awkward. I would
like to be able to simply use a local package the same way I use a normal
package, and my first try was to set the package-conf file in my .ghci
file. But this doesn't work very well for two reasons: (1) it only works
for the interpreter, but not for the compiler (2) it isn't read until
*after* the command line is read, so any packages given there is not
recognized. Is it possible to have a common (.ghc) file that is used for
both the compiler and the interpreter, and that is read *before* the
command line is interpreted?