www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/02/07/15:08:11

From: Robert Hoehne <Robert DOT Hoehne AT Mathematik DOT tu-chemnitz DOT de>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Undefined reference to " class name " virtual table
Date: Fri, 07 Feb 1997 11:23:13 +0100
Organization: TU Chemnitz-Zwickau
Lines: 42
Message-ID: <32FB0291.42E8@Mathematik.tu-chemnitz.de>
References: <CB8B7A0BB5 AT dame DOT fee DOT vutbr DOT cz>
NNTP-Posting-Host: errno.hrz.tu-chemnitz.de
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Stavel Jan wrote:
> 
>             Hallo !
> 
>   Could anyone explain me in short what does the error from ld.exe
> mean :

In short it means, that ld.exe couldn't find in any of your
object files or libraries the virtual table for that class.

But I think you are interested in the reason, why this happened.
There are several reasons:

1) You have in the include file, where the class declared, a
   statement

#pragma interface

   on nowhere in your source files a statement like

#pragma implementation "name_of_file.h"

  This was the technique from gcc before version 2.7. From
  version 2.7 on this not needed any longer, because gcc
  emits now the virtual table in the object file, which
  defines the first not inlined member function of that
  class.

2) You forgot to link a objectfile.

3) (As a result of 1) last paragraph) You forgot to implement
   at least on member function of your class (probably the
   first not-inlined)

Robert
-- 
*****************************************************************
* Robert Hoehne, Fakultaet fuer Mathematik, TU-Chemnitz-Zwickau *
* Post:    Am Berg 3, D-09573 Dittmannsdorf                     *
* e-Mail:  Robert DOT Hoehne AT Mathematik DOT TU-Chemnitz DOT DE              *
* WWW:     http://www.tu-chemnitz.de/~rho                       *
*****************************************************************

- Raw text -


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