Subject: RE: C++ compiler wackyness.
To: <>
From: mjbedy <mjbedy@Oakland.edu>
List: port-pmax
Date: 08/12/1998 21:03:22
The difference between g++ and c++ is that g++ includes -lg++, and c++
does not. So for most things, you can go either way.
The linker hack works for me. I guess I'll go figure out where to add
it to the thing that I'm compiling. Does anyone know if it's an easy fix
(yeah right) to the linker? I wish I knew more about this stuff, I'd help
out. Maybe I should learn.
Anyway, appreciate all the help! (Is Michael Hitch omnipotent? He's
fixed every problem I've ever had with this thing!)
- Mike
> > -----Original Message-----
> > From: Simon Burge [SMTP:simonb@telstra.com.au]
> > Sent: 13. august 1998 02:11
> > To: Harald Bjoroy
> > Cc: 'port-pmax@netbsd.org'
> > Subject: Re: C++ compiler wackyness.
> >
> > Ok, I've got a solution that works (from Michael Hitch) that I won't
> > even pretent to understand. Add:
> >
> > /*
> > * Workaround an ld shared library bug: define these dummy
> > entries to
> > * satisify __do_global_ctors() instead of the entries in
> > libg++.so.
> > */
> > int *__CTOR_LIST__[] = {0};
> > int *__DTOR_LIST__[] = {0,0};
> >
> > somewhere. With these couple of lines, the main.cpp does nothing (not
> > even a core dump :), and the hello.c prints "hello world" - both of
> > which are good things! Here's a snippet from what Michael explains is
> > wrong:
> >
> > defined dummy __CTOR_LIST__ and __DTOR_LIST__ arrays to get
> > around the problem of ld not creating relocation information
> > for the ones defined in the shared libraries. [Even if ld
> > did generate the correct relocation information, I suspect
> > the way these are being used is incorrect.
> >
> > FWIW, my -current system (as of late May) doesn't even compile the
> > test
> > program. I'll try upgrading it to a current -current and see if I can
> > at least compile the program.
> >
> > Simon.
>