Hi, I'm making a little Chess program for my first C++ project. I've done a whole lot of programming before, so don't worry.
OK, I have two static variables of the ChessPiece class:
And I'm trying to access them in the constructor:Code:static uShort whitePieces; static uShort blackPieces;
For some reason, my DJGPP gcc compiler (used through RHIDE, my IDE) returns:Code:if (side == White) { whitePieces++; } else { blackPieces++; }
undefined reference to 'ChessPiece::whitePieces'
undefined reference to 'ChessPiece::blackPieces'
Oh, and yes I have tried this:
Same problem. Can anyone solve this?Code:if (side == White) { ChessPiece::whitePieces++; } else { ChessPiece::blackPieces++; }



LinkBack URL
About LinkBacks


