Thursday, July 30, 2009

Undefined reference to Class::Name (C++)?

So the code is something like that





class Chess {


private:





class Board {


public:


Board();


mark();


};


static queue%26lt;int%26gt; q;





public:


Chess();


};





If you try to ad something to the queue Chess::q from Chess::Board::mark(), it says undefined reference. How to fix this or where to place the q object, to make it visible both in Chess and Chess::Board classes?

Undefined reference to Class::Name (C++)?
The static queue%26lt;int%26gt; q; statement should be placed in the Board class instead of just the Chess class.





I assure u will get no errors.


No comments:

Post a Comment