2010-10-05 110 views
1

我一直在努力为最后20分钟弄清楚为什么它抛出这个错误..错误:预期的构造函数,析构函数或类型转换前的“<”令牌

#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; 

代码抛出这样的:

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

+0

不要用文字处理器编辑你的源代码。并使用std :: vector。 – 2010-10-05 22:49:09

回答

1

也许它需要是std::vector

5

在我看来,你没有指定向量的名称空间,并没有声明你正在使用std :: vector。试试这个:

std::vector<myTriangle> container; 
相关问题