Subject: Re: C++ woes.
To: None <port-arm32@NetBSD.ORG>
From: Stefan Voss <voss@yoda.in-berlin.de>
List: port-arm32
Date: 11/24/1997 18:59:58
In message <Pine.LNX.3.95.971124170925.18743A-100000@ferret.lmh.ox.ac.uk>,
     Alex Hayward wrote:

> 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.

Trying to get kde working, eh? :-)

> 
> 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++?

I also tried to build Qt (shared version) and got the same results. Even
the small examples crash with a segmentation fault. 

I used the original 1.3A comp set. There are some other g++ and stdc++
libs on the ftp server but I didn't use them because the files in the comp
set are more recent.

Regards,
   Stefan

-- 
Stefan Voss
(voss@yoda.in-berlin.de)