title: Classes across multiple files in C++
body: <p>I'm almost 100% sure I have the syntax right in both of these classes, however I'm getting the following errors: </p>
  
  <p>For CShape.cpp - "error C2011: 'CShape' : 'class' type redefinition"
  For CCircle.cpp - "error CS2504: 'CShape': base class undefined"</p>
  
  <p>Here is the full code for CShape.cpp</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  class CShape
  {
  protected:
      float area;
      virtual void calcArea();
  public:
      float getArea()
      {
          return area;
      }
  }
  </code></pre>
  
  <p>And here is the code for CCircle.cpp</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include "CShape.cpp"
  #define _USE_MATH_DEFINES
  #include "math.h"
  using namespace std;
  
  class CCircle : public CShape
  {
  protected:
      int centerX;
      int centerY;
      float radius;
      void calcArea()
      {
          area = M_PI * (radius * radius);
      }
  public:
      CCircle(int pCenterX, int pCenterY, float pRadius)
      {
          centerX = pCenterX;
          centerY = pCenterY;
          radius = pRadius;
      }
      float getRadius()
      {
          return radius;
      }
  }
  </code></pre>
  
  <p>As you can see, CShape is the base class that CCircle is suppsoed to inherit from. I'm pretty new to C++, so I could have the file structures wrong (maybe the base is supposed to be in a header file?), if something like that matters. </p>