Parameter of a global function is undeclared

I'm trying to use a class object as a parameter in a global function which is defined in my main.h, but I'm getting undeclared identifier errors.

1
2
3
4
5
6
7
#ifndef MAIN_H
#define MAIN_H

#include "GameBoard.h"
void scoringRound(GameBoard &board, int callingPlayer);

#endif 


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.

Regards
It did indeed include main.h, and that fixed it. Thanks!
Topic archived. No new replies allowed.