I'm trying to display Tiles of different colors on a screen in C++ through inheritance. I have a base class called Tile and then two derived classes called GreenTile and VanillaTile.
In my main, when I create only a GreenTile or only a VanillaTile by creating either a GreenTile object or a VanillaTile object, it works properly:
GreenTile greenTile(0,0); greenTile.show(screen); The problem is, when I create both GreenTile and VanillaTile objects and try to display both I'm getting "error C2011: 'Tile' : 'class' type redefinition".
GreenTile greenTile(0,0); VanillaTile vanillaTile(0,0); greenTile.show(screen); vanillaTile.show(screen);