gpt4 book ai didi

c++ - : Expected constructor, 析构函数错误,或者 '<' token 之前的类型转换

转载 作者:行者123 更新时间:2023-11-30 00:59:43 24 4
gpt4 key购买 nike

在过去的 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

最佳答案

在我看来,您没有指定 vector 的 namespace ,也没有声明您正在使用 std::vector。试试这个:

std::vector<myTriangle> container;

关于c++ - : Expected constructor, 析构函数错误,或者 '<' token 之前的类型转换,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3868313/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com