I\'m working on some C++ code and I\'ve run into a question which has been nagging me for a while... Assuming I\'m compiling with GCC on a Linux host for an ELF target, wher
This depends heavy on the compiler and runtime. It's not a good idea to make any assumptions on the time global objects are constructed.
This is especially a problem if you have a static object which depends on another one being already constructed.
This is called "static initialization order fiasco". Even if thats not the case in your code, the C++Lite FAQ articles on that topic are worth a read.