title: c++ error: expected ‘;’ before ‘<’ token
body: <p>So I am trying to learn c++ while writing a raytracer and I am kind of struggling a bit with this error when I try to compile using my makefile (which first generates the .o files and then links them). The full error is the following:</p>
  
  <pre><code>touch include/ray.h
  touch include/material.h
  touch include/hit.h
  touch include/object.h
  touch include/light.h
  touch include/scene.h
  touch include/sphere.h
  touch include/directional_light.h
  g++ -c -O -I. raytrace.cpp -o raytrace.o -std=c++0x
  g++ -c -O -I. base/scene.cpp -o base/scene.o -std=c++0x
  g++ -c -O -I. base/vector.cpp -o base/vector.o -std=c++0x
  g++ -c -O -I. base/vertex.cpp -o base/vertex.o -std=c++0x
  g++ -c -O -I. base/colour.cpp -o base/colour.o -std=c++0x
  g++ -c -O -I. objects/object.cpp -o objects/object.o -std=c++0x
  g++ -c -O -I. objects/sphere.cpp -o objects/sphere.o -std=c++0x
  g++ -c -O -I. base/material.cpp -o base/material.o -std=c++0x
  g++ -c -O -I. base/ray.cpp -o base/ray.o -std=c++0x
  g++ -c -O -I. lights/light.cpp -o lights/light.o -std=c++0x
  g++ -c -O -I. lights/directional_light.cpp -o lights/directional_light.o -std=c++0x
  g++ -c -O -I. base/hit.cpp -o base/hit.o -std=c++0x
  g++ -c -O -I. base/matrix.cpp -o base/matrix.o -std=c++0x
  touch include/t_stack.h
  g++ -c -O -I. t_stack/matrix_w.cpp -o t_stack/matrix_w.o -std=c++0x
  touch include/t_stack.h
  g++ -c -O -I. t_stack/t_stack.cpp -o t_stack/t_stack.o -std=c++0x
  In file included from t_stack/t_stack.cpp:1:
  ./include/t_stack.h:12: error: expected ‘;’ before ‘&lt;’ token
  ./include/t_stack.h:13: error: expected ‘;’ before ‘&lt;’ token
  </code></pre>
  
  <p>The code that is causing the problem is the t_stack.h file:</p>
  
  <pre><code>1 #ifndef _STACK_H_
  2 #define _STACK_H_
  3
  4 #include &lt;stack&gt;
  5 #include &lt;list&gt;
  6 #include &lt;iostream&gt;
  7 #include "include/matrix.h"
  8 #include "include/matrix_w.h"
  9 
  10 class T_stack {
  11    private:
  12        stack&lt;Matrix_w*, list&lt;Matrix_w* &gt; &gt;* m_stack;
  13        list&lt;Matrix&lt;double&gt;* &gt;* t_list;
  14    public:
  15        T_stack();
  16        void pop();
  17        void push_translation(double tx, double ty, double tz);
  18        void push_scaling(double sx, double sy, double sz);
  19        int size() const;
  20        ~T_stack();
  21 };
  22
  23 #endif
  </code></pre>
  
  <p>I have already checked the other files that are included in this one such as matrix.h and matrix_w.h and I am pretty sure they are not missing any semicolons or any of that stuff. I even tried compiling everything but the t_stack.h file and it builds correctly... Any ideas what might be the problem? It is a bit weird because before I tried merging these files with the rest of the code I did a couple of tests with simpler programs and it all worked fine... Help is greatly appreciated. Thanks!</p>