比如已有: testView.h testDoc.h resource.h mynewfile.cpp 如果要在mynewfile.cpp中添加testView.h, 有时会提示 undeclared identifier 等错误. 所以需要在mynewfile.cpp添加testView.h之前,添加testDoc.h resource.h. 这样就不会有问题了.