开发者

Expected specifier-qualifier-list before 'b3Vec'

开发者 https://www.devze.com 2023-01-31 16:35 出处:网络
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:

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 hea开发者_如何学编程der files right and it's the only error I get.

Can anyone help me?


You need to use the struct keyword:

struct b3Vec gravitation;
0

精彩评论

暂无评论...
验证码 换一张
取 消