When forward declarations of functions work in a source file (.cpp), why would the same doesn\'t work for classes ?
Thanks.
// main.cpp
void forwar
You're getting the error message on int One:: statVar = 10 ;
NOT on the forward declaration, which is fine.
The compiler needs to know the full definition of the class before you can define static members like that - a forward declaration is insufficient (it needs to be able to confirm that the type is correct from the class definition).
You'll need to move your static attribute definition below the class definition.