What is vtable anchoring, and how does it work in a shared object?
<p>I was performing research into some issues with a C++ library and ensuring type information is consistent between the application and the shared object. I'm also interested in ensuring an <strong><em><code>EqualObject</code></em></strong> comparison works, meaning I indeed have the same object, and not two objects that happen to be equal under <strong><em><code>operator==</code></em></strong>.</p>

<p><a href="https://stackoverflow.com/a/10962454/608639">This answer</a> state to anchor a vtable in a header. I'm not familiar with the technique. Or I've heard it called by another name.</p>

<p>What is vtable anchoring, and how does it work?</p>

<hr>

<p>I'm also aware of <a href="https://gcc.gnu.org/faq.html#dso" rel="nofollow noreferrer">dynamic_cast, throw, typeid don't work with shared libraries</a> from the GCC FAQ.</p>