Compiling and #include not seeming to have an effect
Posted on 1998-07-22
I have a class called Human it is defined in Human.h and implemented in Human.cpp. Now Have another class called LoosenCommand. In LoosenCommand.h I have a #include "Human.h" then the constructor for LoosenCommand takes a Human*. When I do CC on LoosenCommand I get Human is undefined? Why is this? I seemed to have fixed it using class Human; declaration at the top. It now compiles but as soon as the refrence to a Human is hit in LoosenCommand it crashes, so that leads me to beleive that I have just told the compiler Human will be declared later, but LoosenCommand never finds it. So how do I do this?