Hi,
I just did the very usefull
tutorial to manage different screens in games (or sfml applications).
But something couldn´t be right in this tutorial, because I got a lot of errors, although I had copy&paste the whole code.
Ok, my project includes 4 header files and one main(cpp) file.
The header files are called screen.h, screens.h, screen_0.h and screen_1.h.
In the header file screens.h I included the basic class (in the header file screen.h) and the two other classes.
I think till now everything should be ok, but than there comes some strange things. For example, in the tutorial the basic class (in screen.h) is declared as
class cScreen
{
//...
};
and the main function says
std::vector<cScreen*> Screens;
Allright, but in screen_0.h "class screen_0" inherit from cScreen, but the author wrotes
class screen_0 : public Screen
{
private:
//...
};
As you can see is this a mistake.
But I fixed such mistakes, compiled the code and get errors like
error C2011: 'Screen': 'class' Typeredefinition
for the basicclass.
And for the code, where one class inherit from the basicclass
Basicclass undefined
.
Does anybody else this tutorial and got the same or similar problems?
I really got no idea what could be wrong with this code.
Would be really really nice if somebody could compile the code on his system and help me!
Thanks in advance!