Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!bloom-beacon!mcgill-vision!clyde.concordia.ca!ccu.umanitoba.ca!rpjday From: rpjday@ccu.umanitoba.ca Newsgroups: comp.lang.c++ Subject: multiple inheritance problem? Message-ID: <1990Aug24.104618.17291@ccu.umanitoba.ca> Date: 24 Aug 90 10:46:18 GMT Organization: University of Manitoba, Winnipeg, Canada Lines: 56 G'day eh? I am experiencing a bizarre compile time problem using the AT&T 2.0 cfront with the generic Sun C compiler. To wit: class base { . . public: objptr() .... } From this, I derive two more classes: class derived1: virtual public base { ... } class derived2: virtual public base { ... } The reason for the "virtual" is that I use multiple inheritance to derive a third class from the above two derived classes. class derived3: public derived1, public derived2 { ... } All of the above is based on the explanation given in Eckel's book "Using C++" (as opposed to, I suppose, admiring it or taking it for a walk). The reason for the "virtual" is allegedly to prevent ambiguity in class "derived3" when it realizes it has inherited two identical "objptr" methods. This sounds perfectly reasonable until one gets around to compiling. The error msg (which I reproduce from memory, so be tolerant) is AT&T 2.00 C++ ... error: bus error (The little addendum to the above error msg is not my editorial, it's part of the error msg.) The msg gives the line number for a line in the application program for which derived3 derf ; . . . . derf -> objptr() ; <-- offending line Is the multiple inheritance really set up properly? Is this a known bug? Have I done something totally stupid? R. Day U of M