title: c++ inheritance /redefinition error
body: <p>The Shape Header File   </p>
  
  <p>ERROR: Constructor for 'Rectangle' must explicitly initialize the base class 'Shape' which does not have a default constructor</p>
  
  <pre><code> #ifndef Rectangle_hpp
  #define Rectangle_hpp
  
  #include "shape.hpp"
  
  #include &lt;stdio.h&gt;
  
  class Rectangle:public Shape{
      double m_length;
      double m_width;
  public:
      Rectangle(double length,double width):Shape("Rectangle"){}
      double getPerimeter();
      double getArea();
  
  };
  
  #endif /* Rectangle_hpp */
  </code></pre>
  
  <p>The Shape cpp File</p>
  
  <p>ERROR: Redefinition of 'Rectangle'</p>
  
  <pre><code>#include "Rectangle.hpp"
  
  #include "shape.hpp"
  #include "Rectangle.hpp"
  
  Rectangle::Rectangle(double length,double width):Shape("Rectangle"){
      m_length = length;
      m_width = width;
  }
  double Shape::getPerimeter(){
      return 2;
  }
  double Shape::getArea(){
      return 2;
  }
  </code></pre>
  
  <p>BASE class Header File</p>
  
  <pre><code>#ifndef shape_hpp
  #define shape_hpp
  
  #include &lt;stdio.h&gt;
  
  class Shape{
      const char* m_name;
  public:
      Shape(const char* name);
      virtual double getPerimeter()=0;
      virtual double getArea()=0;
      char getType();
  };
  
  #endif /* shape_hpp */
  </code></pre>
  
  <p>Base Class cpp file</p>
  
  <pre><code>#include "shape.hpp"
  
  Shape::Shape(const char* name){
      m_name = name;
  }
  
  char Shape::getType(){
      return *m_name ;
  }
  </code></pre>
  
  <p>I made another class "Circle" with the same layout as Rectangle and didnt get any errors, these errors are only appearing the the rectangle class.. i am stuck and have no idea why.</p>