You can slightly influence the initialization order using special directives for the compiler. MSVC has a pragma
#pragma init_seg({ compiler | lib | user | "section-name" [, func-name]} )
which can somewhat prioritize a specific module. See this link for init_seg .
The gcc compiler has a similar / related attribute syntax to set the relative priority of a particular initialization. Looks like this
Some_Class A __attribute__ ((init_priority (2000))); Some_Class B __attribute__ ((init_priority (543)));
and explained on this page init_priority .
Bo persson
source share