Probably either one of the classes is forward declared only. Adding suitable include directives should fix the problem.