www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/08/21/07:28:15

Xref: news-dnh.mv.net comp.os.msdos.djgpp:1680
Path: news-dnh.mv.net!mv!news.sprintlink.net!EU.net!dkuug!Norway.EU.net!nntp-oslo.UNINETT.no!nntp-trd.UNINETT.no!nora!jensen
From: jensen AT nora DOT gih DOT no (erik jensen)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Strange DJGPP behaviour with pure virtual functions
Date: 21 Aug 1995 09:45:34 GMT
Organization: UNINETT news service
Lines: 37
References: <DDnG3L DOT IE1 AT jade DOT mv DOT net>
Nntp-Posting-Host: nora.gih.no
To: djgpp AT sun DOT soe DOT clarkson DOT edu
Dj-Gateway: from newsgroup comp.os.msdos.djgpp

Jorrit Tyberghein (Jorrit DOT Tyberghein AT uz DOT kuleuven DOT ac DOT be) wrote:
: Hi,

: Normally I develop my program under Linux using GCC 2.6.2. I had
: just programmed some new features and for the first time I used
: some pure virtual functions. All this worked perfectly in Linux.
: Then I copied my sources to DOS to make the DOS version of my
: program (like I do all the time). When I tried to compile the
: program with DJGPP 1.12maint4 I got the following error at link
: time: __pure_virtual not defined.

: I tried including the -lgpp and -lgpl libraries but this didn't
: help. I solved the problem by making the pure virtual functions
: not pure virtual anymore. So
: 	xxx () = 0
: became
: 	xxx () { }
: Functionally this is the same but I would prefer the use pure
: virtual functions for obvious reasons.

: What can I do to fix this problem? Is this a bug in DJGPP?

: Greetings and many thanks in advance,

Are you sure all your pure virtual functions are defined in the
derived classes?  The point with pure virtual functions is to
enforce the derived classes to have their own versions.  (Defining
the base member empty, ie { }, not = 0, makes a default function
to fall back on when the member functions is missing in the 
derived class.)

What sucks with the error message is DJGPP is that it doesn't say
_which_ virtual function is missing, so you have to look around
a bit.

Erik

- Raw text -


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