public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Eric Britten <ebritten@uci.edu>
To: gnu-win32@cygnus.com
Subject: Missing virtual functions
Date: Wed, 27 Aug 1997 07:06:00 -0000	[thread overview]
Message-ID: <33FF524B.7B256D82@uci.edu> (raw)

Yesterday I found that if one declares virtual functions in a class
like:

class A
{
    A();
    virtual void B();
};

and the definitions for the functions(inline or external) are not found
by the linker then two types of linking errors result.

1.  Undefined reference to a vtable in the constructors of the class.
2.  Undefined reference to any other inline functions of the class that
are used by other code.

It took me a while to figure out that if all virtual functions are
defined, then these errors go away.  Is this GNU specific?  It would
help if the linker complained of undefined references to the virtual
function without a definition, rather than the missing vtable.  Of
course this would help those unfamiliar with this error, I already know
the cause.

Eric Britten

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

             reply	other threads:[~1997-08-27  7:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-08-27  7:06 Eric Britten [this message]
1997-09-01 18:30 ` Fergus Henderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=33FF524B.7B256D82@uci.edu \
    --to=ebritten@uci.edu \
    --cc=gnu-win32@cygnus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).