0

I am writing a chess program. I have a player class and I have a chessboard class, among many other classes. My program was compiling before on xcode and linux.

The compiler keeps saying 'Player has not been declared' for the ChessBoard.h header file, and 'Chessboard has not been declared' for the Player.h

Player.h

    #ifndef PLAYER_H
    #define PLAYER_H
    #include <string>
    #include "ChessBoard.h"


    using namespace std;

    class Player {

ChessBoard.h

#ifndef CHESSBOARD_H
#define CHESSBOARD_H


/*
ChessBoard object stores a 2D representation of 32 ChessPieces.
Checks for win or tie after each move
*/

#include "Player.h"
#include "ChessPiece.h"

//Board size
const int SIZE = 64;

class ChessBoard {
public:

Both include guards have an #endif and the cpp implementation files contain includes to the header file.

Why am I getting this error message? Thanks

0 Answers0