Sign in to follow this  
POLSKASH

Inheritance Problem

Recommended Posts

I have a pure abstract class called GameState. TitleScreen and OnePlayer both inherit from it. Then I try to include TitleScreen and OnePlayer headers into a PongGame.h, which needs both of them. It says I'm redefining the GameState type. c:\Documents and Settings\Owner\Desktop\Pong\GameState.h(11) : error C2011: 'GameState' : 'class' type redefinition c:\Documents and Settings\Owner\Desktop\Pong\GameState.h(11) : see declaration of 'GameState' PongGame.cpp c:\Documents and Settings\Owner\Desktop\Pong\GameState.h(11) : error C2011: 'GameState' : 'class' type redefinition c:\Documents and Settings\Owner\Desktop\Pong\GameState.h(11) : see declaration of 'GameState' TitleScreen.cpp I tried to include the virtual keyword when deriving, class TitleScreen : public virtual GameState class OnePlayer : public virtual GameState to no avail. Does anyone know of a solution here?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this