Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!olivea!uunet!godzilla!kohlrabi!robert From: robert@kohlrabi.tcs.com (Robert Blumen) Newsgroups: comp.lang.c++ Subject: Re: Multiple Inheritance Problem Message-ID: <2153@godzilla.tcs.com> Date: 6 May 91 19:06:41 GMT References: <74462@brunix.UUCP> Sender: root@tcs.com Reply-To: robert@kohlrabi.tcs.com (Robert Blumen) Organization: Teknekron Communications Systems Lines: 39 In article <74462@brunix.UUCP>, thc@cs.brown.edu (Thomas Colthurst) writes: |> class Object { |> public: |> Object(); |> ~Object(); |> virtual void Draw() = 0; |> virtual void Update() = 0; |> virtual Object* Dup() = 0; |> } |> class Line: public virtual Object { |> public: |> Line(); |> ~Line(); |> void Draw(); |> } |> class Dependent: public virtual Object { |> public: |> Dependent(); |> ~Dependent(); |> void Update(); |> } |> class DependentLine : public Line, public Dependent { |> public: |> DependentLine(); |> ~DependentLine(); |> Object *Dup() { return( (new DependentLine) ); }; // error here |> } |> Sun CC version 2.1 gives me an error on the line |> marked above, saying |> "./ChildrenObjs.H", line 30: error: `new' of abstract class DependentLine For one thing, a class that inherits a pure virtual function must define it or redefine it to be pure virtual. ----------------------------------------------------------------------------- Robert Blumen | rblumen@tcs.com Senior Software Engineer | 2121 Allston Way, Berkeley, CA 94704 Teknekron Communications Systems, Inc. | (415) 649-3759