title: Error C2143: syntax error : missing ';' before 'namespace'
body: <p>I am VERY new to C++ and Open GL and I have been trying to display 3D objects in a scene. it worked fine with one but when I tried to alter my code to add a second, my code regarding the HUD text showing the camera location started giving errors. The error above is shown and it is apparently in the sstream file (#include). I have tried searching around and asking for help but there is nothing that helps/that I understand. When I comment-out the #include line and the code that uses it, I get a similar saying "error C2143: syntax error : missing ';' before 'using'" in my main.cpp file.</p>
  
  <p>I am running Visual Studio 2010 and I have even tried turning the whole thing off and on again, and copying the code over to a new project. Help would be greatly appreciated.</p>
  
  <pre><code>#include &lt;Windows.h&gt;
  #include &lt;GL/gl.h&gt;
  #include &lt;GL/glu.h&gt;
  #include "glut.h"
  #include "SceneObject.h"
  #include &lt;fstream&gt;
  #include &lt;sstream&gt;
  #include &lt;iostream&gt;
  #include &lt;string&gt;
  //#include &lt;cmath&gt;
  //#include &lt;limits&gt;
  //#include &lt;cstdlib&gt;
  
  using namespace std;
  </code></pre>
  
  <p>...</p>
  
  <pre><code>stringstream ss;
  ss &lt;&lt; "Camera (" &lt;&lt; cam.pos.x &lt;&lt; ", " &lt;&lt; cam.pos.y &lt;&lt; ", " &lt;&lt; cam.pos.z &lt;&lt; ")";
  glClear(GL_DEPTH_BUFFER_BIT);
  outputText(-1.0, 0.5, ss.str());
  </code></pre>
  
  <p>...</p>
  
  <pre><code>#ifndef SCENEOBJECT_H
  #define SCENEOBJECT_H
  #include &lt;string&gt;
  #include &lt;iostream&gt;
  #include &lt;fstream&gt;
  
  using namespace std;
  
  struct point3D {
      float x;
      float y;
      float z;
  };
  
  struct colour{
      float r;
      float g;
      float b;
  };
  
  struct tri {
      int a;
      int b;
      int c;
  };
  
  class SceneObject {
  private:
      int NUM_VERTS;
      int NUM_COL;
      int NUM_TRI;
      point3D  * vertices;
      colour * colours;
      tri  * indices;
      void drawTriangle(int a, int b, int c);
  public:
      SceneObject(const string fName) {
          read_file(fName);
      }
      void drawShape()
      {
          // DO SOMETHING HERE
      }
      int read_file (const string fileName)
      {
      ifstream inFile;
      inFile.open(fileName);
  
      if (!inFile.good())
      {
          cerr  &lt;&lt; "Can't open file" &lt;&lt; endl;
          NUM_TRI = 0;
          return 1;
      }
  
      //inFile &gt;&gt; shapeID;
  
      inFile &gt;&gt; NUM_VERTS;
      vertices = new point3D[NUM_VERTS];
  
      for (int i=0; i &lt; NUM_VERTS; i++)
      {   
          inFile &gt;&gt; vertices[i].x;
          inFile &gt;&gt; vertices[i].y;
          inFile &gt;&gt; vertices[i].z;
      }
  
      inFile &gt;&gt; NUM_COL;
      //inFile &gt;&gt; randomCol;
      colours = new colour[NUM_COL];
      /*if (randomCol == 'y')
      {
          for (int i=0; i &lt; NUM_COL; i++)
          {
              colours[i].r = ((float) rand() / (RAND_MAX+1));
              colours[i].g = ((float) rand() / (RAND_MAX+1));
              colours[i].b = ((float) rand() / (RAND_MAX+1));
          }
      }
      else if (randomCol == 'n')
      {*/
          for (int i=0; i &lt; NUM_COL; i++)
          {   
              inFile &gt;&gt; colours[i].r;
              inFile &gt;&gt; colours[i].g;
              inFile &gt;&gt; colours[i].b;
          }
      //}
  
      inFile &gt;&gt; NUM_TRI;
      indices = new tri[NUM_TRI];
  
      for (int i=0; i &lt; NUM_TRI; i++)
      {   
          inFile &gt;&gt; indices[i].a;
          inFile &gt;&gt; indices[i].b;
          inFile &gt;&gt; indices[i].c;
      }
  
      inFile.close();
      return 0;
  }
  }
  #endif
  </code></pre>
  
  <p>I haven't changed the  code and as far as I am aware, there are semi-colons where there are meant to be. Even my friend who has been programming for 5 years couldn't solve this. I will include any other specific code if needed. And when I said new to C++ and OpenGL I really much VERY new.
  This is even my first post. I'll get there eventually.</p>