linking with c++ libraries

Julian Seward (Intl Vendor) v-julsew@microsoft.com
Mon, 30 Jul 2001 06:06:07 -0700


| To reliably link with C++, you need to compile both the code=20
| which invokes C++ (i.e. whatever uses the C++ library) and=20
| "main" (that is, ghc/rts/Main.c, not main.hs) with a C++ compiler.
|=20
| So, in summary:
|=20
| 	- Compile any code which may call the C++ library (and keep
| 	  inter-module inlining in mind; probably safest to compile
| 	  all of your code this way) via C, and compile the C with g++.
|=20
| 	- Re-compile the run-time system (at least Main.c) with
| 	  g++, too.
|=20
| That may not fix your specific core dump, but you'll need to=20
| do this anyway.

After some discussion in the GHC office, we're unsure about why
you need to compile Main.c with a C++ compiler for this to work.

Pls can you clarify?

J