Want to avoid cyclic dependency with board and game pieces

I have a class Board which handles all of the pieces on the board. It sets them up and handles their removal.

Now, I want to have the ability to detect a click on the individual game pieces. I know this is possible using:

Mesh->OnClicked.AddDynamic

My problem is that I want to alert the game board that the object has been clicked. Here in lies my problem. For me to report back to the board, this requires including the header for the board and thus creating an unsightly cyclic dependency.

How can I avoid this?

It is OK to include the Board header file in your GamePiece cpp file. What you should probably try to avoid it including the Board header in your GamePiece header, along with the GamePiece header in your Board header.

Instead, it would be acceptable to forward declare the Board class in the GamePiece header. Just add

class Board;

UCLASS()
// Your GamePiece class
{

};

to the top of your header file. Then in the cpp actually include the header. This will allow you to create a pointer to the Board class as a member variable in GamePiece without the full include file.