Everything was working when the board object was also global, but after shifting it to inside of a nested loop within main(), it now needs to be included as a parameter.
I see "main.h" includes "GaimBoard.h". Does "GameBoard.h" include "main.h" inside it also? I ask, because such recursive includes cause a certain type of problem. Try inserting class GameBoard; before line 5.