Error compiling C++ program
I get this error while compiling: error:开发者_运维百科 aggregate 'X x' has incomplete type and cannot be defined
I have three classes in 6 different files(header file + 3 implementation files). when I try to compile all these classes with a main, It gives me the above error. I am not including any header file in other header files, I am doing that in implementation files. So, I think its not a case of "cross reference". I am not sure what is the problem with my code can anyone help me in that?
Thanks
Somehow, that class isn't being defined when it needs to be.
Firstly, make sure the header has actually been included. Further, make sure you have include guards, and that you don't have circular includes and recursive definitions. Aside from that, without the code we cannot give specifics.
精彩评论