You have no the default constructor. So when you are declaring an object of type Button you have to specify all arguments for the constructor that is defined in the class.
1 2 3 4
Title() : PlayButton( /* all arguments that correspond to the parameters of the Button constructor */ ),
SoundButton( /* all arguments that correspond to the parameters of the Button constructor */ )
After doing some searching ive found a solution which was to define all the functions in the class TitleState.
I am not sure why this solved the problem though and am unsure if it is really solved or will cause me more problems later on ?
If anyone can explain this to me i would be grateful :)
The reason your solution worked, is because of this: TitleState::TitleState:PlayButton(//etc
And for reference, the error: error: found ':' in nested-name-specifier, expected '::'|
It should have been: TitleState::TitleState::PlayButton(//etc
One additional colon is all you needed.
Anyways, your solution works because there was no need for you to write out the scope of your function, which is what caused the previous error due to a missing colon.
the problem with the colon was because i hadnt included the parenthesis after TitleState.
If i did what you said that wouldnt compile either.
Thanks for trying to help though :)
I was actually asking why defining all the functions in TitleState stopped the vTable error ?