From: khan AT xraylith DOT wisc DOT edu (Mumit Khan) Subject: Re: b20: c++ bug or feature? 19 Nov 1998 04:54:40 -0800 Message-ID: <9811181953.AA28805.cygnus.gnu-win32@modi.xraylith.wisc.edu> References: To: Andres Heinloo Cc: gnu-win32 AT cygnus DOT com, egcs AT cygnus DOT com Andres Heinloo writes: > > when compiling gtk-- example program 'OhharaDraw', I get the following > error: > > OhharaDraw.h:130: sorry, not implemented: object size exceeds normal limit > for virtual function table implementation, recompile all source and use > -fhuge-objects [ I'm copying egcs as well. Hopefully egcs C++ folks will provide some insight into this ] The hierarchy looks like this: Gtk_Signal_Base <-V- Gtk_Base <--- Gtk_Object <--- Gtk_Widget <--- Gtk_Container <--- Gtk_Bin <--- Gtk_Window <--- OhharaDraw Where I've marked the virtual inheritence with '<-V-'. When building the vtable for ``OhharaDraw'', the compiler is running into the limitation that the offset is represented by a signed short, and cannot hold -45054 (the resulting offset for type info function in this case). Any target platform that does not use vtable "thunks" is affected by this. For example, HPUX is as affected by it as ix86-win32. ix86-linux uses vtable thunks by default, so it works there. Solutions? (1) Recompile *everything* with -fvtable-thunks. I don't know if it works for x86-win32 targets. (2) Recompile *everything* with -fhuge-objects. Hardly an option for real life code. Also, I don't know how well debugged -fhuge-objects really is, so you might be running into other compiler/library bugs there. (2) Since there is no multiple inheritance in this particular case (I don't know anything about Gtk's design, so may be way off here), make Gtk_Signal_Base just a public base class instead of public virtual base class. Regards, Mumit - For help on using this list (especially unsubscribing), send a message to "gnu-win32-request AT cygnus DOT com" with one line of text: "help".