undefined reference to vtable with inheritance
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/12020462/undefined-reference-to-vtable">Undefined reference to vtable</a>  </p>
</blockquote>



<p>Running the following code is causing a linker error </p>

<p><code>'undefined reference to vtable for ManagedObjects'</code></p>

<pre><code>#include &lt;cstdlib&gt;
#include &lt;iostream&gt;
#include &lt;list&gt;
#include &lt;string&gt;
using namespace std;

class ManagedObjects
{
      public:
      virtual string get() const;
      virtual ~ManagedObjects(){};
};

class CallbackOwner1 : public ManagedObjects
{
public:
       string get() const {return "CallbackOwner1";} 
};

class CallbackFunctor
{
public:
    CallbackFunctor(const ManagedObjects* b):m_cbr(b)
    {}
    string operator() ()
    {
        return m_cbr-&gt;get();
    }

   const ManagedObjects* m_cbr;
};

int main(int argc, char *argv[])
{
    ManagedObjects* cb1 = new CallbackOwner1();
    CallbackFunctor f(cb1);
    cout &lt;&lt; f() &lt;&lt; endl;

    system("PAUSE");
    return EXIT_SUCCESS;
}
</code></pre>
