I'm getting this error message from my compiler:
undefined reference to `Pawn::Pawn(Piece::Color)'
This occurs when I do this:
// board[][] contains pointers to Piece objects
board[0][0] = new Pawn(Piece::BLACK);
Here's part of the Pawn class:
// Includes...
#include "piece.h"
// Includes...
class Pawn : public Piece {
public:
// ...
// Creates a black or white pawn.
Pawn(Color color);
// ...
};
Here's part of the Piece class:
class Piece {
public:
// ...
enum Color {WHITE, BLACK};
// ...
};
Why am I getting this compiler error?