Thanks, but I think I wasn't clear enough. |
I'm not sure what exactly you don't understand.
The class "Human" already exists in another file. |
True, but class Human uses class Orc, and Orc uses Human, but they cannot simultaneously include each other. And that's where the problem began.
The trick is as I described. For the purposes of the declaring Orc, the compiler doesn't need to know exactly what Human is. To know that the parameter is a pointer to a class is sufficient because pretty much all pointers to a class are the same size.
However, in the orc.cpp file, you must use:
1 2
|
#include "orc.hpp"
#include "human.hpp"
|
This is because, to generate the code for Orc, it needs to see human.hpp. Note, that this is different from the declaration.
I noticed you ignored other changes I made to that header file. You really ought to consider them.