tags:

views:

71

answers:

2

I have been trying for the last 20 minutes figuring out why it is throwing this error..

#include <GL/glut.h>
#include <vector>

// global width and height
int GW;
int GH;

// current mouse position in pixel coordinate
int x;
int y;

typedef struct myTriangle {
   float tx;
   float ty;
} myTriangle;

vector<myTriangle> container;

The code throws this:

Transform.cpp:17: error: expected constructor, destructor, or type conversion before '<' token

+1  A: 

Maybe it needs to be std::vector?

Mark Ransom
+5  A: 

Looks to me like you haven't specified the vector's namespace and haven't declared that you are using std::vector. Try this instead:

std::vector<myTriangle> container;
JeffW