Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The ISO C++ Standard specifies that all virtual methods of a class that are not pure-virtual must be defined.</p> <p>Reference:</p> <p><strong>C++03 Standard: 10.3 Virtual functions [class.virtual]</strong> </p> <blockquote> <p>A virtual function declared in a class shall be defined, or declared pure (10.4) in that class, or both; but no diagnostic is required (3.2).</p> </blockquote> <p>So either you should make the function pure virtual or provide a definition for it. </p> <p>If you are using gcc, You might get some weird errors if you fail to follow this standard specification. The <strong><a href="http://gcc.gnu.org/faq.html#vtables" rel="noreferrer">gcc faq</a></strong> doccuments it as well: </p> <blockquote> <p>The ISO C++ Standard specifies that all virtual methods of a class that are not pure-virtual must be defined, but does not require any diagnostic for violations of this rule <code>[class.virtual]/8</code>. Based on this assumption, GCC will only emit the implicitly defined constructors, the assignment operator, the destructor and the virtual table of a class in the translation unit that defines its first such non-inline method.</p> <p>Therefore, if you fail to define this particular method, the linker may complain about the lack of definitions for apparently unrelated symbols. Unfortunately, in order to improve this error message, it might be necessary to change the linker, and this can't always be done.</p> <p>The solution is to ensure that all virtual methods that are not pure are defined. Note that a destructor must be defined even if it is declared pure-virtual <code>[class.dtor]/7</code>.</p> </blockquote>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload