[comp.lang.c++] problem w/ C++ 2.0 and virtual base classes

dcmartin@cheddar.cs.wisc.edu (David C. Martin) (06/29/90)

I am using InterViews under AT&T 2.0 and get the following error when
attempting to compile:
---
	SlotField*	sfp;
	
	sfp = new SlotField(ftype->name, fname);
-->	Insert(sfp);
	sfp->Bind(ftype, vp, count);
---
"TupleField.e", line 124: error: cast: SlotField* -> base Interactor*; Interactor is base more than once
*** Error code 2

Stop.
---
The code above is in a virtual function of TupleField that allocates SlotField
instances and then utilizes the non-virtual function Insert() that is defined
by the class Interactor.  This is my inheritence hierarchy:
---
class Field : virtual public Interactor
class SceneField : public Field, virtual public Scene
class MonoSceneField : public SceneField, virtual public MonoScene
class BoxField : public SceneField, virtual public Box
class HBoxField : public BoxField, virtual public HBox
class VBoxField : public BoxField, virtual public VBox
class SlotField : public HBoxField
class TupleField : public VBoxField
---
What I am attempting to do is leverage the functionality of InterViews
w/ some additional techniques for walking database objects (i.e. using
IV for displaying values from the DBMS).  Could someone explain to me
why I am getting this error, and if this hierarchy is a correct use of
the virtual base class system?

Thanks

dcm
--
To rescue for human society the native values of rural life.
--
Computer Sciences Department                       mail: dcmartin@cs.wisc.edu
University of Wisconsin - Madison                  uucp: uunet!uwvax!dcmartin
1210 W. Dayton St, Madison WI 53706                at&t: 608/262-6624
--
To rescue for human society the native values of rural life.
--
Computer Sciences Department                       mail: dcmartin@cs.wisc.edu
University of Wisconsin - Madison                  uucp: uunet!uwvax!dcmartin
1210 W. Dayton St, Madison WI 53706                at&t: 608/262-6624