Maybe you are already compiling it as C++, I was just guessing.
Do you get the error if you only compile golf.h? If it compiles fine on its own then the problem must be caused by the other files that include the it.
//for golf.h (erroneous; placed in "Headers")
#ifndef golf_H
#define golf_H
enum {Len = 40}; //when I changed to this, there was no "variably error".
...
#endif
1 2 3 4 5 6 7 8 9 10
//For main.cpp (placed in "Sources")
#include <iostream>
#include "golf.h"
int main()
{
...
return 0;
}
Actually golf.h shouldn't be compiled, it should be #included.
Yes, compiling it as part of the build process is unnecessary, but it should still be possible to compile it on its own without errors otherwise something is wrong.