c++ - Compiler error C4430: missing type specifier - int assumed -


this question has answer here:

i have error:

"error c4430: missing type specifier - int assumed. note: c++ not support default-int"

with code example :

//a.h     #include "b.h" class a{     b* b;     .. };  //b.h #include "a.h" class b{      a* a; // error error c4430: missing type specifier - int assumed. }; 

this circular dependency issue. declaring pointer class, definition of class not needed; i.e. type doesn't have complete type. don't need include a.h in b.h, forward declaration enough. such as:

//b.h class a; // change include of a.h forward declaration class b {      a* a; }; 

Comments

Popular posts from this blog

java - Intellij Synchronizing output directories .. -

git - Initial Commit: "fatal: could not create leading directories of ..." -