First of all, let me tell you that I'm super noob with C++. So, sorry if i'm asking something stupid, but i'm completely stuck.
I'm trying to port a little game engine i wrote in AS3 to C++ and I have started with the core Game class. It has to store the levels, to update and manage them, so I think pointers is the way to go.
The header looks like this:
#pragma once
#include "Level.h"
class Game
{
public:
Level *level;
Level *nextLevel;
Game(void);
virtual ~Game(void);
virtual void begin();
virtual void onEveryFrame();
private:
void changeLevel();
};
And the compiler throws me two errors for every pointer declaration :
Error 1 error C2143: syntax error : missing ';' before '*'
Error 2 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
So, what am I doing wrong ? The error description doesn't looks too descriptive to me.
(I'm using VS Express 2012)
EDIT :
Sorry guys! Looks like is a circular dependency problem. Nothing to do with the pointers actually.
The "Level.h" was something like this:
#pragma once
#include "Game.h"
class Level
{
public:
Game *game;
Level(void);
virtual ~Level(void);
virtual void begin();
virtual void onEveryFrame();
};
Sorry guys, noob error. :(