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

How to access named pipes using JavaScript in Firefox add-on? -

multithreading - OPAL (Open Phone Abstraction Library) Transport not terminated when reattaching thread? -

node.js - req param returns an empty array -