First of all, get those #includes out of inside those #ifndef's
Your problem is your C file includes the opponent.h file first, which in turn includes player, before the opponent class is even defined.
As a work around include
class opponent;
Above the class player declaration.
This is typically used for cross-dependent header files!
But in implementation of classes, one should keep in mind dependendencies of classes, etc. If you need a cross-dependency, then typically your object data needs reorganization in a layering of dependencies. Like a stack of pancakes, dependencies are always upwards!
wildgoose
Practically a Posting Shark
896 posts since Jun 2009
Reputation Points: 546
Solved Threads: 99