title: Error: expected type-specifier before 'ClassName'
body: <pre><code>shared_ptr&lt;Shape&gt; circle(new Circle(Vec2f(0, 0), 0.1, Vec3f(1, 0, 0)));
  
  shared_ptr&lt;Shape&gt; rect(new Rect2f(Vec2f(0, 0), 5.0f, 5.0f, 0,
                                    Vec3f(1.0f, 1.0f, 0))              );
  </code></pre>
  
  <p>I'm trying to understand why the above won't compile. For Whatever reason, when I try to create an instance of Rect2f (which DOES inherit from the <code>Shape</code> class specified the <code>shared_ptr</code> template argument, just like <code>Circle</code>), I get the following <strong>errors</strong>:</p>
  
  <pre><code>error: expected type-specifier before 'Rect2f'
  error: expected ')' before 'Rect2f'
  </code></pre>
  
  <p>Everything about the <code>Circle</code> <code>shared_ptr</code> is perfectly fine. There are no problems with it; it's only the <code>Rect2f</code> which is causing issues. </p>
  
  <p>Furthermore, the values passed into the constructor are valid. </p>
  
  <p>So, what could the issue be with this one? I have <code>Rect.h</code> included for this. For brevity's sake (and incase I missed something in that file which may be affecting this), I'll post the following:</p>
  
  <p><strong>Rect.h</strong></p>
  
  <pre><code>#pragma once
  
  #include &lt;QGLWidget&gt;
  #include &lt;GL/glext.h&gt;
  #include &lt;cmath&gt;
  #include &lt;QDebug&gt;
  #include "Shape.h"
  #include "Vec3f.h"
  #include "rand.h"
  
  const int DEFAULT_SQUARE_WIDTH = 5;
  const int DEFAULT_SQUARE_HEIGHT = 5;
  
  typedef enum {
      RC_TOPLEFT,
      RC_TOPRIGHT,
      RC_BOTTOMRIGHT,
      RC_BOTTOMLEFT
  } RectangleCorner;
  
  class Rect2f : public Shape
  {
  public:
  
      Rect2f(
          Vec2f center = Vec2f(),
          float width = 4,
          float height = 4,
          float radius = 0,
          Vec3f color = Vec3f()
      );
  
      ~Rect2f();
  
      inline const float GetWidth( void ) const {
          return mWidth;
      }
  
      inline const float GetHeight( void ) const {
          return mHeight;
      }
  
      inline const Vec2f* GetCorner( RectangleCorner rc ) const {
          switch( rc ) {
          case RC_TOPLEFT:
              return mTopLeftCrnr;
              break;
  
          case RC_TOPRIGHT:
              return mTopRightCrnr;
              break;
  
          case RC_BOTTOMLEFT:
              return mBottomLeftCrnr;
              break;
  
          case RC_BOTTOMRIGHT:
              return mBottomRightCrnr;
              break;
          }
      }
  
      void UpdateCorners();
  
      virtual void Collide( Shape &amp;s );
  
      virtual void Collide( Rect2f &amp;r );
  
      virtual void Collide ( Circle &amp;c );
  
      virtual bool Intersects( const Shape&amp; s ) const;
  
      virtual bool Intersects( const Rect2f&amp; s ) const;
  
      virtual bool IsAlive( void ) const;
  
      virtual float Mass( void ) const;
  
  protected:
  
     virtual void Draw( void ) const;
     float mWidth, mHeight;
     Vec3f mColor;
  
  private:
     Vec2f* mTopLeftCrnr;
     Vec2f* mTopRightCrnr;
     Vec2f* mBottomLeftCrnr;
     Vec2f* mBottomRightCrnr;
  
  };
  </code></pre>
  
  <p><strong>Source of Error Function and File Header (mainwindow.cpp)</strong></p>
  
  <pre><code>#include "ui_mainwindow.h"
  #include "Vec2f.h"
  #include "Rect2f.h"
  #include "SharedPtr.h"
  
  MainWindow::MainWindow(QWidget *parent) :
      QMainWindow(parent),
      ui(new Ui::MainWindow)
  {
      ui-&gt;setupUi( this );
  
      BoxOfShapes* display = new  InteractiveBoxOfShapes( this, 600, 600 );
      ui-&gt;mGridLayout-&gt;addWidget( display );
      ui-&gt;mStatusBar-&gt;showMessage( "status ok" );
  
      QObject::connect( display, SIGNAL( numShapesChanged( int ) ), this, SLOT( setNumShapes(int) ) );
      QObject::connect( ui-&gt;mResetButton, SIGNAL( pressed() ), display, SLOT( resetWorld() ) );
      shared_ptr&lt;Shape&gt; circle(
                  new Circle(
                      Vec2f( 0, 0 ),
                      0.1,
                      Vec3f( 1, 0, 0 ) ) );
      /*std::shared_ptr&lt;Shape&gt; rect( &lt;---error
                       new Rect2f(
                          Vec2f( 0, 0 ),
                          5.0f,
                          5.0f,
                          0,
                          Vec3f( 1.0f, 1.0f, 0 )
                      )
                  );*/
      shared_ptr&lt; Shape &gt; rect( new Rect2f() ); //error - second attempt 
      display-&gt;addShape( circle );
      display-&gt;addShape( rect );
  }
  </code></pre>
  
  <p><strong>Main Function Test (main.cpp)</strong></p>
  
  <pre><code>#include &lt;QtGui/QApplication&gt;
  #include "mainwindow.h"
  #include "Rect2f.h"
  
  int main(int argc, char *argv[])
  {
      Rect2f rec;
  
      QApplication a(argc, argv);
      MainWindow w;
      w.show();
  
      return a.exec();
  }
  </code></pre>
  
  <p><strong>Question</strong></p>
  
  <p>Judging from the errors provided, what am I missing here? Also, what can be done to rectify this issue?</p>