 <p>Static objects are destroyed in the reverse of the order in which they're constructed (e.g. the first-constructed object is destroyed last), and you can control the sequence in which static objects are constructed, by using the technique described in Item 47, "<strong>Ensure that global objects are initialized before they're used</strong>" in Meyers' book <em>Effective C++</em>.</p> <blockquote> <p>For example to specify in some way that I would like a certain object to be destroyed last, or at least after another static onject?</p> </blockquote> <p>Ensure that it's constructed before the other static object.</p> <blockquote> <p>How can I control the construction order? not all of the statics are in the same dll.</p> </blockquote> <p>I'll ignore (for simplicity) the fact that they're not in the same DLL.</p> <p>My paraphrase of Meyers' item 47 (which is 4 pages long) is as follows. Assuming that you global is defined in a header file like this ...</p> <pre><code>//GlobalA.h extern GlobalA globalA; //declare a global </code></pre> <p>... add some code to that include file like this ...</p> <pre><code>//GlobalA.h extern GlobalA globalA; //declare a global class InitA { static int refCount; public: InitA(); ~InitA(); }; static InitA initA; </code></pre> <p>The effect of this will be that any file which includes GlobalA.h (for example, your GlobalB.cpp source file which defines your second global variable) will define a static instance of the InitA class, which will be constructed before anything else in that source file (e.g. before your second global variable).</p> <p>This InitA class has a static reference counter. When the first InitA instance is constructed, which is now guaranteed to be before your GlobalB instance is constructed, the InitA constructor can do whatever it has to do to ensure that the globalA instance is initialized.</p>