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?
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.