Original Post
Problem: A class contains a variable type of another class (in a different .h file). I'm getting three errors that don’t seem to make any sense at all. Can anyone help me on this? As the only solution I could think of, I've moved "Grid grid;" from player.h back to block.h, where class Grid is defined. It was the only way I could get it to work, but a lot of other unrelated redefinition issues arose (look at last post). ////////////////////////////// errors: error C2146: syntax error : missing ';' before identifier 'grid' and two of these: error C4430: missing type specifier - int assumed. Note: C++ does not support default-int All point to the same line in player.h (Grid grid;). ////////////////////////////// player.h #ifndef __PLAYER_H #define __PLAYER_H #include "main.h" #include "block.h" class Player { private: public: Grid grid; }; #endif ////////////////////////////// block.h #ifndef __BLOCK_H #define __BLOCK_H class Block { private: public: }; class Grid { private: public: }; #endif [Edited by - ronaldo on April 30, 2006 10:22:07 AM]