开发者

Expected specifier-qualifier-list before '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 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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜