I am writing code where I have three header files: figure, triangle, and rectangle. Triangle and rectangle classes inherit the figure class. I have all the functions defined in the class declarations and don't need an implementation file. When I compile, I get this error: error C2011: 'Figure' : 'class' type redefinition. Below is one of the header files for one of the derived classes, the others are more or less identical.
What is the proper method of setting this up?
#include <iostream>
#include "figure.h"
using namespace std;
class Rectangle: public Figure
{
public:
Rectangle(){cout << "Rectangle Constructor" << endl;}
~Rectangle(){cout << "Rectangle Destructor" << endl;}
void erase(){cout << "Rectangle Erase" << endl;}
void draw(){cout << "Rectangle Draw" << endl;}
void center(){cout << "Rectangle Center" << endl;}
};