I have a small query, How to create and export Singleton class from DLL? that could be share across multiple modules of same application. My intention is to create a centralized custom logging system that would log in same file.
Any example or link will be appreciated.
The link ajitomatix posted is for a templated singleton, a non-template solution could look like this:
Where LOGGING_API is defined as
It looks like you’re already aware of this, but for completeness sake the Meyer’s singleton works as long as your code is in a DLL on windows, if you link it as a static library, it won’t work.