Hej mam problem, wyskakuje mi błąd i nie wiem co jest tego przyczyną.
#pragma once
#include <stack>
#include <SFML/Graphics.hpp>
#include "GameState.h"
class Game
{
public:
Game();
~Game();
std::stack<GameState*> states;
sf::RenderWindow window;
void pushState(GameState* state);
void popState();
void changeState(GameState* state);
GameState* peekState();
void gameLoop();
};
#pragma once
#include "Game.h"
class GameState
{
public:
Game *game;
virtual void draw(const float dt) = 0;
virtual void update(const float dt) = 0;
virtual void handleInput() = 0;
};
Błąd wyskakuje w miejscu, gdy dodaję do klasy GameState wskaznik na klasę game.
Game *game;
Błędy:
- syntax error missing ';' before '*'
- missing type specifier - int assumed. note c++ does not support default-int
- unexpected token(s) preceding ';'
Proszę o pomoc :)