What is “error C2061: syntax error : identifier “?

You have a circular include dependency. Collision.h includes Player.h and vice versa. The simplest solution is to remove #include "Collision.h" from Player.h, since the Collision class is not needed in the Player declaration. Besides that, it looks like some of your includes in Collision.h can be replaced by forward declarations:

// forward declarations
class Player;
class Platform;

class Collision
{
public:
  Collision(void);
  ~Collision(void);
  static bool IsCollision(Player &player, Platform& platform);
};

You can then put the includes in Collision‘s implementation file.

Leave a Comment