Subject: C++ woes.
To: None <port-arm32@NetBSD.ORG>
From: Alex Hayward <xelah@ferret.lmh.ox.ac.uk>
List: port-arm32
Date: 11/24/1997 17:15:05
I've been trying to compile the qt library, which uses C++, but I've come
across a few problems. I've compiled both static and shared version. The
static version seems to work (well, the simple tutorial examples work) but
linking with the shared one results in core dumps.

I tried linking togethor a couple of test C++ files, one of which defines
a class with a method which prints something out, the other has main in
it, prints something, creates an instance of this other class and then
calls the print method in it. This works fine when compile with gcc (but
fails when compiled with g++) without -fPIC or -fpic. It fails when I add 
either to the second source file's options. In fact, when -fPIC is used it
succesfully does the initial print (the one in main) and manages to call
and return from the method defined in the other source file. However, the
string which is printed out is garbage.

Have I done something wrong or is there a problem with -fPIC/pic and C++?

-- 
alex@hayward.u-net.com; xelah@ferret.lmh.ox.ac.uk