预期的说明符限定符列表位于“b3Vec”之前
这应该是一个简单的问题,但我无法弄清楚问题所在。
我有一个在 3D 空间中定义向量的结构,在 vectors.h
中:
/**
* The struct defining vectors in 3D space.
*/
struct b3Vec {
/**
* The size of the vector.
*/
double size;
/**
* The first direction of the vector in degrees.
*/
double dir1;
/**
* The second direction of the vector in degrees.
*/
double dir2;
};
在另一个结构中,在 world.h
中称为 b3World 我有这个:
b3Vec gravitation;
我收到错误在此行“b3Vec”之前的预期说明符限定符列表
。我正确地包含了头文件,这是我得到的唯一错误。
谁能帮助我吗?
This should be a simple one, but I can't figure out the problem.
I have a struct defining a vector in 3D space, in vectors.h
:
/**
* The struct defining vectors in 3D space.
*/
struct b3Vec {
/**
* The size of the vector.
*/
double size;
/**
* The first direction of the vector in degrees.
*/
double dir1;
/**
* The second direction of the vector in degrees.
*/
double dir2;
};
In another struct, called b3World in world.h
I have this:
b3Vec gravitation;
I'm getting the error on this line Expected specifier-qualifier-list before 'b3Vec'
. I'm including the header files right and it's the only error I get.
Can anyone help me?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要使用
struct
关键字:You need to use the
struct
keyword: