<p>I just ran across the following error (and found the solution online, but it's not present in Stack Overflow):</p>

<blockquote>
  <p>(.gnu.linkonce.[stuff]): undefined
  reference to [method] [object
  file]:(.gnu.linkonce.[stuff]):
  undefined reference to `typeinfo for
  [classname]'</p>
</blockquote>

<p>Why might one get one of these "undefined reference to typeinfo" linker errors?</p>

<p>(Bonus points if you can explain what's going on behind the scenes.)</p>

This occurs when declared (non-pure) virtual functions are missing bodies. In your class definition, something like:
```
```
virtual void foo();
```
```
Should be defined (inline or in a linked source file):
```
```
virtual void foo() {}
```
```
Or declared pure virtual:
```
```
virtual void foo() = 0;
```
```