Whenever I try to compile/build my game then I get these 2 errors:
||=== Build: Debug in TotalWar (compiler: GNU GCC Compiler) ===|
C:\|25|error: invalid use of incomplete type 'class Scene'|
C:\|2|error: forward declaration of 'class Scene'|
||=== Build failed: 2 error(s), 0 warning(s) (0 minute(s), 2 second(s)) ===|
Here's my code:
Where I forward declared Scene class:
// App.hpp
#pragma once
class Scene;
class App
{
public:
enum States
{
STATE_INTRO,
STATE_QUIT,
STATE_MAIN_MENU,
STATE_PLAYING
};
const int Width = 800;
const int Height = 600;
static States CurrentState;
static Scene* CurrentScene;
sf::RenderWindow Window;
sf::Clock* Clock;
float Dt;
App(std::string &title);
~App();
void SetScene(Scene& scene);
void Clear();
void Display();
void Close();
sf::RenderWindow* GetWindow();
float GetDt();
void ChangeState(States newState);
};
And in Scene.cpp(Where the error happens)
void Gui::Scene::DrawCurrentScene(float dt)
{
App::CurrentScene->Draw(dt);
}
When I try to call App::CurrentScene->Draw then the error happens, help please.