You can't instantiate a forward declared class until the class definition for that class has been encountered by the linker.
Try declaring it with extern. Should work. Basically you are telling the linker that this class is defined in some object file, forcing external linkage. You are just using it here.
But, the bottom line is that instantiating objects in headers is not a good practice.
Do you really need that object in all the cpp files in which the header will be included? It is hard to believe.
There is a programming pattern, called Singleton. I think this best suites your needs if you need a single instance of an object across an application.
You just create a class with a private constructor and a getter function which returns the single instance of this class.
You can find more about it on the internet.
Regards
Bookmarks