expected class-name before ‘{’ token

Why am I getting :

Player.h:15:1: error: expected class-name before ‘{’ token

Enemy.h:9:1: error: expected class-name before ‘{’ token

in my game engine code?

Thanks

https://drive.google.com/open?id=1GR3JDE63E0FUZuvk4gezq_Md8JNZM3pT
You problem is #include "Game.h" in SDLGameObject.h. It creates circular dependencies. Since it's unnecessary just remove it.
Then I can't compile line 19 "TheGame::Instance()" on line 19 SDLGameObject.cpp. Would I have to use forward declaration instead? can you show me where and how? thanks.
No forward declaration. Just #include "Game.h" into the SDLGameObject.cpp. On the one side.

On the other side TheGame::Instance()->getRenderer()); seems unnecessary.
Topic archived. No new replies allowed.