I get this error message from my compiler:
undefined reference to `Pawn::Pawn(Piece::Color)'
This happens when I do this:
// board[][] contains pointers to Piece objects
board[0][0] = new Pawn(Piece::BLACK);
Here is part of the Pawn class:
#include "piece.h"
class Pawn : public Piece {
public:
Pawn(Color color);
};
Here is part of the Piece class:
class Piece {
public:
enum Color {WHITE, BLACK};
};
Why am I getting this compiler error?
source
share