Errors with includes and inheritance and pure virtual functions

Why am I geting "expected class name before { token" in player.h line 15 and Enemy.h line 9? Why is m_joysticks not recognized in Game.cpp when I declared it in inputhandler.h? why is m_joysticValues not recognized when I declared it in Vector2d.h? Why is m_joystickDeadZone not recognized when I declared it in InputHandler.h? and what should I do about Player.h: In member function ‘void Player::clean()’:
Player.h:25:20: error: cannot call member function ‘virtual void GameObject::clean()’ without object
GameObject::clean();
?

I am a noob so I presume you dont have to include extra.h files in cpp files when you can put them in the .h file is that right?

Thanks.

Enemy.cpp https://pastebin.com/936kWzsV
Enemy.h https://pastebin.com/8GB5CP3W
Game.cpp https://pastebin.com/TTWJWWX1
Game.h https://pastebin.com/izbiMWhb
GameObject.cpp https://pastebin.com/Jq67SgfJ
GameObject.h https://pastebin.com/izbiMWhb
InputHandler.cpp https://pastebin.com/UEVSg9eb
InputHandler.h https://pastebin.com/se2VtvCC
LoaderParams.h https://pastebin.com/ewQRj8hu
main.cpp https://pastebin.com/ANTMEBZJ
Player.cpp https://pastebin.com/B41H6kTV
Player.h https://pastebin.com/2e56AS9r
SDLGameObject.cpp https://pastebin.com/Tc7PqbGk
SDLGameObject.h https://pastebin.com/r9bFRWde
TextureManager.cpp https://pastebin.com/mYDrkcsw
TextureManager.h https://pastebin.com/JqwP8p8W
Vector2d.h https://pastebin.com/1aUGyjQf
I am a noob so I presume you dont have to include extra.h files in cpp files when you can put them in the .h file is that right?

The preprocessor constructs one file containing the contents of the source file and all the header files that were included in it. So, yes, if A.h includes B.h, then you can have your source file include A.h and B.h will be automatically included. There's no need to have the source file also include B.h.
m_joysticks and m_joystickDeadZone are members of the class InputHandler. You're trying to use them as if they're members of Game, but they're not.
Topic archived. No new replies allowed.