main.h(16): error C2512: '__BITMAP' : no appropriate default constructor available
global.h(4): error C2355: 'this' : can only be referenced inside non-static member functions
global.h(4): error C2864: 'MyGlobalClass::pGlobInst' : only static const integral data members can be initialized within a class
global.h(4): error C2355: 'this' : can only be referenced inside non-static member functions
It does not thing it is static. It tels you where can you use it.
You can use this only inside non-static member functions
As your use context is not within any member function, it is illegal.
global.h(4): error C2864: 'MyGlobalClass::pGlobInst' : only static const integral data members can be initialized within a class
To use default values that way you should have C++11 mode turned on.
Before C++11 you could only initialize static const members like that. And your member is not static and not const at all.
This information does not help because it cannot work. The design is wrong.
What cannot work? What design is wrong? How?
1 2 3 4 5 6 7 8 9 10
class Foo {
std::vector<Bar> gaz;
public:
Foo()
: gaz( 1, Bar( this ) ) // initialize vector gaz via its fill constructor to contain one element
// The Bar-type object in the element is initialized with a pointer to this Foo object
{}
};