
__declspec(dllexport)/__declspec(dllimport) needs to be specified in order that the variable can be exported from the DLL it is defined in and imported in client DLL's & EXE's. This will give you a per-process singleton, if you want a singleton instance shared by *all* clients of the DLL of which it is defined use #pragma data_seg(".SHARED"). Thanks. I already familiar with windows dlls (unfortunately?). I've made all those things you have mentioned (besides "shared") (I can sent you a source code, if you are interested). The problem is, that
On 5/8/05, Terence Wilson <tez@latte.com> wrote: the Singleton library is header-only library, and stores singleton manager(s) in static function variable(s). And when those code inlined into several different dlls,it results independent static variables in different modules (although is same code), which, in its turn, results multiple singleton instances. -- Best regards, Zigmar