You must inherit publicly from A , e.g.
class ProductA1 : public ProductA { ...
Without the public keyword, this relationship is a private inheritance, which is not an is-a relationship, so you cannot just distinguish from ProductA1 to ProductA .
Scott Meyers explains this in Effective C ++, Third Ed. Item 39:
[...] when a hierarchy is defined in which the Student class is publicly inherited from the Person class, implicitly converts students into people when it is necessary for a successful function call.
[...] the first rule governing private inheritance that you just saw in action: unlike general inheritance, compilers usually do not convert an object of a derived class (for example, Student ) to an object of a base class (for example Person ), if the inheritance relationship is between classes is private. [...] The second rule is that members inherited from a private base class become private members of the derived class, even if they were protected or public in the base class.
Means of private inheritance implemented-in-conditions. If you make class D privately inherit from class B , you will do it because you are interested in using some of the functions available in class B , and not because there is any conceptual connection between objects of types B and D Thus, private inheritance is purely a method of implementation.
Update for the second version of the message: if you want to use pure virtual functions, you must declare them like this:
virtual void draw_lines(double pt1, double pt2) = 0; virtual void draw_curves(double pt1, double rad) = 0;
Otherwise, the linker will skip its definition.