Inheritance problem ?
Posted on 1998-06-08
Hello, I have run into an error using code similar to this:
Bar(Foo *afoo,int i) :foo(afoo)
// I have a couple other classes like Bar, call them Bar1 and Bar2
class Child:public Foo
The idea is that Foo acts as abase class for a bunch of derived classes, which initialize their Bar members with different values. The Bar memebrs all have a pointer to the class that contains them, so that they can use its methods.
In the Child constructor, I get the following error:
"Foo:a" is not an unambiguous base class of "Child".
This happens with every single member of Foo I try to initialize, even with ints, longs, etc. (not just classes).
What does the error mean ? How do I fix it ? I realize that I can put all the initialization in the Foo constructor, but I don't want to do this since there will be too many parameters for me to pass.