error : use undefined type

Did you #include “OtherClass.h” in your cpp file?