delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/03/06/12:51:59

Message-Id: <m0yAvb4-000S2iC@inti.gov.ar>
Comments: Authenticated sender is <salvador AT natacha DOT inti DOT gov DOT ar>
From: "Salvador Eduardo Tropea (SET)" <salvador AT inti DOT gov DOT ar>
Organization: INTI
To: Vic <tudor AT cam DOT org>, djgpp AT delorie DOT com
Date: Fri, 6 Mar 1998 14:48:30 +0000
MIME-Version: 1.0
Subject: Re: HELP: C++ virtual problems
In-reply-to: <34FFB616.699E@cam.org>

Vic <tudor AT cam DOT org> wrote:

> I'm making this GUI in C++. I declared a base class, XbaseWidget that
> contains virtual functions like MouseUp, mouseDown etc.
> Each other class is derived from this one (like the buttons, dsktop etc)
> It all compiles without any warnings (I use -c -Wall -O ) but when I
> want to link it, I get "undefined reference to XbaseWidget virtual
> table". What is this? I don't have much experience in C++ and I really
> don't have any ideea what is going on.
> this is an example of the class declarations (full sources are available
> if this would help)

 It happends when you don't created all the members that you declared. You must 
specify code for ALL the members. Even if you create a pure-virtual base class 
you must specify at least a dummy for the members or explicitly say that they 
are initialized to 0 (virtual members are pointers to functions they must 
point to somewhere).
 That's the most common case, there are others. 

SET
------------------------------------ 0 --------------------------------
Visit my home page: http://set-soft.home.ml.org/
or
http://www.geocities.com/SiliconValley/Vista/6552/
Salvador Eduardo Tropea (SET). (Electronics Engineer)
Alternative e-mail: set-sot AT usa DOT net - ICQ: 2951574
Address: Curapaligue 2124, Caseros, 3 de Febrero
Buenos Aires, (1678), ARGENTINA
TE: +(541) 759 0013

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019