title: Strange Undefined Reference to Vtable Error
body: <p>...which I cannot seem to figure out, for whatever reason. I've tried cleaning my build files in Qt as well, and that hasn't seemed to work either.</p>
  
  <p>First off, let me state that I'm well aware that this error typically crops up when a C++ class inherits an abstract class with pure virtual functions, and the inheriting class (for whatever reason) hasn't defined them yet. </p>
  
  <p>The issue is that there are NO pure virtual functions <strong>which exist in relation to the error specified</strong>.</p>
  
  <p>I have a base class known as <code>CoordinateObject</code>, with an abstract class, <code>Shape</code>, which inherits from that base class, along with a <code>FirstPersonCamera</code> class which also inherits from <code>CoordinateObject</code>. Now, my <code>Cubef</code> class inherits from <code>Shape</code>, and when I try to compile the code, I get the following errors:</p>
  
  <pre><code>./debug\Camera.o:Camera.cpp:(.rdata$_ZTVN6Engine17FirstPersonCameraE[vtable for Engine::FirstPersonCamera]+0x10): undefined reference to `Engine::FirstPersonCamera::InitCoordinates()'
  ./debug\Cubef.o:Cubef.cpp:(.rdata$_ZTVN6Engine5CubefE[vtable for Engine::Cubef]+0x1c): undefined reference to `Engine::Cubef::InitCoordinates()'
  </code></pre>
  
  <p>Originally this cropped up when <code>CoordinateObject</code> <em>did</em> have a pure virtual function <code>InitCoordinates</code>, however, after trying to implement that properly within every class which chose to inherit from it, it still didn't work. Thus, I removed it (along with every class implementation and declaration except for the base class itself).</p>
  
  <p>So, I need to know exactly what I'm doing <strong>wrong</strong> here. I'll post code as follows:</p>
  
  <p><strong>Code</strong></p>
  
  <p><em>CoordinateObject.h</em></p>
  
  <pre><code>class CoordinateObject
      {
      public:
  
          CoordinateObject( void );
  
          virtual ~CoordinateObject( void )
          {
              delete mWorld;
              delete mObject;
              delete mInertial;
          }
  
          Matrix3fv GetInertialSpace( void );
  
          Matrix3fv GetObjectSpace( void );
  
          Matrix3fv GetWorldSpace( void );
  
          void SetInertialSpace( Matrix3fv* space );
  
          void SetInertialSpace( Matrix3fv&amp; space );
  
          void SetObjectSpace( Matrix3fv* space );
  
          void SetObjectSpace( Matrix3fv&amp; space );
  
          void SetWorldSpace( Matrix3fv* space );
  
          void SetWorldSpace( Matrix3fv&amp; space );
  
      protected:
  
          Matrix3fv* mWorld;
          Matrix3fv* mObject;
          Matrix3fv* mInertial;
  
      private:
  
          void InitCoordinates( void );
      };
  </code></pre>
  
  <p><em>Shape.h</em></p>
  
  <pre><code>#pragma once
  
  #include "stdafx.h"
  
  namespace Engine
  {
      class Circlef;
  
      class Shape
              : public CoordinateObject
      {
  
      public:
  
          Shape( Vector3f&amp; center, float radius );
  
          virtual ~Shape( void )
          {
              delete mCenter;
          }
  
          virtual void Collide( Shape&amp; s ) = 0;
  
          virtual void Collide( const Circlef&amp; s ) = 0;
  
          Vector3f* Center( void );
  
          virtual void Draw( void ) = 0;
  
          void SetCenter( Vector3f newCenter );
  
          void SetCenter( Vector3f* newCenter );
  
          float mRadius;
  
      protected:
  
          Vector3f* mCenter;
  
      private:
  
          void InitShape( Vector3f&amp; center );
      };
  }
  </code></pre>
  
  <p><em>Cubef.h</em></p>
  
  <pre><code>#pragma once
  
  #include "stdafx.h"
  
  namespace Engine
  {
      class Cubef
              : public Shape
      {
      public:
          Cubef( Vector3f center, float radius );
  
          virtual ~Cubef( void )
          {
              delete mCenter;
          }
  
          virtual void Collide( Shape&amp; s );
  
          virtual void Collide( const Circlef&amp; s );
  
          virtual void Draw( void );
  
          void Draw( const Vector3f&amp; camPosition );
  
          void Draw( const Vector3f&amp; newCenter, float radius, const Vector3f&amp; camPosition );
  
          void DrawFront( void );
  
          void DrawBack( void );
  
          void DrawLeft( void );
  
          void DrawRight( void );
  
          void DrawTop( void );
  
          void DrawBottom( void );
  
          inline double GetEdgeLength( void ) const
          {
              return mEdgeLength;
          }
  
          inline int GetCubeId( void ) const
          {
              return mCubeId;
          }
  
          inline double GetSurfaceArea( void ) const
          {
              return mSurfaceArea;
          }
  
          void Rotatef( float angle, AngleOfRotation aor );
  
          void Rotatef( float angle, Vector3f* toRotate, AngleOfRotation aor );
  
      protected:
  
          static int CubeCount;
  
          const int mCubeId;
  
          float mSurfaceArea;
  
          float mEdgeLength;
  
      private:
  
      };
  
  }
  </code></pre>
  
  <p>And finally, <em>Camera.h</em></p>
  
  <pre><code>namespace Engine
  {
      extern const float PI;
  
      extern const double MOUSE_Y_SENSITIVITY;
  
      extern const double MOUSE_X_SENSITIVITY;
  
      extern const int FP_CAM_QUAT_ARR_LEN;
  
      class FirstPersonCamera
              : public CoordinateObject
      {
      public:
          FirstPersonCamera( void );
  
          ~FirstPersonCamera( void );
  
          void Rotate( SDL_Event*&amp; event );
  
          inline Vector3f GetPosition( void ) const
          {
              return *mPosition;
          }
  
          inline Matrix3fv GetRotation( void ) const
          {
              return *mRotation;
          }
  
          void MoveCamera( const SDL_KeyboardEvent&amp; event );
  
          void UpdateCamera( void );
  
          void UpdateCamera( const Vector3f&amp; coords );
  
      private:
  
          void InitCamera( void );
  
          Matrix3fv* mRotation;
  
          Vector3f* mPosition;
  
          float mAngle;
      };
  
  }
  </code></pre>
  
  <p>I've even tried initializing the default constructor of <code>CoordinateObject</code>'s ctor in any deriving class' initialization list, but honestly I doubt that makes a difference. </p>
  
  <p><strong>Example</strong></p>
  
  <p>(from <em>Shape.h</em>)</p>
  
  <pre><code>Shape::Shape( Vector3f&amp; center, float radius )
      : CoordinateObject(),
        mRadius( radius )
  {
      InitShape( center );
  }
  </code></pre>
  
  <p>As you can see, <code>CoordinateObject</code>'s constructor is called here, <em>in</em> the initialization list, even though it is default.</p>
  
  <p>I'm at a loss as to what to do.</p>
  
  <p>Halp?</p>