I have seen this type of error everywhere and, although I have looked at the answers, none seem to help.
I get the following error with the following piece of code:<
Replace the include with a forward declaration:
include
//B.h class A; class B{ public: static bool doX(A *a); };
Include files only when you have to.
Also, use include guards. This will prevent other nasty issues like re-definitions & such.