I'm having an odd error pop up, and cant seem to figure out why its happening. I'm using code to help me manage screens within my application. The code I am using is found here
https://github.com/SFML/SFML/wiki/Tutorial:-Manage-different-Screens. My problem is that within my cscreen.hpp and screen_0.hpp I am getting a class undefined and redefinition error. Has anyone encountered this before or could it be an IDE(VS2013) setting I've messed up.
Minimal Code
cScreen.hpp
#include "SFML\Graphics.hpp"
class cScreen
{
public:
virtual int Run(sf::RenderWindow &App) = 0;
};
screens.hpp
#ifndef SCREENS_HPP_INCLUDED
#define SCREENS_HPP_INCLUDED
//Basic Screen Class
#include "cScreen.hpp"
//Including each screen of application
#include "screen_0.hpp"
#endif // SCREENS_HPP_INCLUDED
Screen_0.hpp
#include <iostream>
#include "cScreen.hpp"
#include <SFML/Graphics.hpp>
class screen_0 : public cScreen
{
private:
...
public:
screen_0(void);
virtual int Run(sf::RenderWindow &App);
};
screen_0::screen_0(void)
{
...
}
int screen_0::Run(sf::RenderWindow &App)
{
...
}
main.cpp
#include <iostream>
#include <SFML/Graphics.hpp>
#include "screens.hpp"
int main(int argc, char** argv)
{
...
return EXIT_SUCCESS;
}
ERRORS
Error 1 error C2011: 'cScreen' : 'class' type redefinition