   Error regarding missing semicolon
  Hi. When I compile my project (using VS2010) I get the following error:Quote:Event.h(6): error C2236: unexpected 'class' 'Event'. Did you forget a ';'?Event.h:#pragma once#include <typeinfo>#include "Actor.h"class Event{  public:  Event() {};  unsigned long getType() const {return type;};  protected:  unsigned long type;};class MoveActorEvent : public Event{  public:  MoveActorEvent(unsigned int actorId, char yDirection) : actorId(actorId), yDirection(yDirection) {type=typeid(*this).hash_code();};  ActorId getActorId()    const {return actorId;};  char    getYDirection() const {return yDirection;};  private:  ActorId actorId;  char yDirection;};class CloseEvent : public Event{  public:  CloseEvent() {type=typeid(*this).hash_code();};};class BallDeadEvent : public Event{  public:  BallDeadEvent(unsigned char side) : side(side) {type=typeid(*this).hash_code();};  unsigned char getSide() const {return side;};  private:  unsigned char side;};class ToggleFpsEvent : public Event{  public:  ToggleFpsEvent() {type=typeid(*this).hash_code();};};and Actor.h:#pragma once#include <SFML/Graphics.hpp>typedef unsigned long ActorId;class Actor{  public:  Actor(sf::Vector2f position, float rotation, sf::Image* image, unsigned long actorId);  ActorId getActorId()  const {return actorId;};  float   getMaxSpeed() const {return maxSpeed;};  sf::Vector2f getPosition() const {return sprite.GetPosition();};  float   getRotation() const {return sprite.GetRotation();};  sf::Vector2f getVelocity() const {return velocity;}  sf::Vector2f getSize()const {return sprite.GetSize();};  sf::Sprite const& getSprite()   const {return sprite;};  void    setImage(sf::Image* newImage)    {image=newImage;};  void    setMaxSpeed(float newMaxSpeed)   {maxSpeed=newMaxSpeed;};  void    setPosition(sf::Vector2f newPosition) {sprite.SetPosition(newPosition);};  void    setRotation(float newRotation)   {sprite.SetRotation(newRotation);};  void    setVelocity(sf::Vector2f newVelocity) {velocity=newVelocity;};    private:  ActorId actorId;  sf::Vector2f velocity;  float   maxSpeed;  sf::Image*   image;  sf::Sprite   sprite;};If I add a ';' before 'class Event', it compiles. But I guess I'm missing something very basic here. Any help would be appreciated.   
  If anything you seem to have too many semicolons in your code (after some member functions are defined).   ;  Try to rename the class 'Event' to something else.   ;  What I would do is start commenting things out until it compiles. Then slowly un-comment things until it breaks again; that'll show you whatever line is causing the issue.   ;  You don't need to add a ; at the end of the line when you declare the function body. For example:  Event() {};would be  Event() {}  unsigned char getSide() const {return side;};would be  unsigned char getSide() const {return side;}The only place you do need a ; at the end of the line in your current code is the Actor() constructor since the body stay undefined (probably defined in a .cpp elsewhere). edit: The ; at the end of variable declaration and at the end of the class } bracket needs to be there too.If you still get the error after removing them, I often see the "Did you forget a ';'?" error message just before declaring a variable with an undefined type, but it's not this exact error message.   ;  In a situation like this I'd generate a preprocessed file for the offending source file and examine that output to see what the actual preceding line is. For Visual Studio you can do this by going to project properties or the property for a specific source file and visit the C/C++, Preprocessor section.   ;  Thx SiCrane, I was unaware of this trick. Is it normal for a source file (in a semi-complex project using some libs) to be composed of 400,000 lines? Most of them are just empty blank line, but I still think it's a whole lot.   ;  Unfortunately, yes, that's normal.   ;  May I point out that superfluous semicolons don't cause errors so long as they are legally placed. That is, you can put;;;;;;right in the middle of your program so long as everything around it is syntactically correct. Bottom-line is, having an unneeded semicolon after those inline member function definitions is likely not causing the error.   ;Quote:Original post by simiusTry to rename the class 'Event' to something else.Why?Quote:Original post by SiCranceIn a situation like this I'd generate a preprocessed file for the offending source file and examine that output to see what the actual preceding line is. For Visual Studio you can do this by going to project properties or the property for a specific source file and visit the C/C++, Preprocessor section.I'll try that when I get back home. Thanks for the tip.   