[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: MODule players



On Fri, 21 Mar 1997, Philippe Troin wrote:

> 
> On Fri, 21 Mar 1997 00:36:13 MST Jason Gunthorpe (jgg@gpu.srv.ualberta
> .ca) wrote:
> 
> > Does anyone know how to control the order in which constructors are called
> > during program startup (for global static objects). To allow the metaclass
> > construction to work properly I need to have assurance it will do it in
> > the right order. Watcom, Borland and High C all had pragmas to control
> > this, I couldn't find such a thing in GCC yet. 
> 
> I don't know if there is.
> This shouldn't be needed for good nice C++ code :-)
> There are ugly workarounds though...

Well, it's either have the compile instantiate the classes during the
pre-main phase based on what libaries are linked in, or have it done
manually during the first several lines of main, requiring gobs of headers
and other unpleasantness. They way it is now with GCC at least I can
define what mod formats, output devices etc I want included by simply
changing the linker line. The various bits don't really care what is
included. I'd rather like to keep it that way ;>

Jason


Reply to: