Skip to content

spdlog as shared library, global log registration. #2198

Answered by tt4g
rioki asked this question in Q&A
Discussion options

You must be logged in to vote

This is due to the spdlog design and the C++ language specification.
spdlog was previously header-only library, but with version 1.4.0, static library and shared library build support has been added.

Since support for the header-only library is still in place, spdlog keeps default loggers and logger registry in variables with the static keyword in order to manage the global state.

And in the C++ language specification, static variables are placed in dedicated memory storage on a per-build basis (libraries, executables).

With this specification, the default logger variables accessed when spdlog is built as a shared library and the default logger variables accessed by applications linked wi…

Replies: 3 comments 8 replies

Comment options

You must be logged in to vote
5 replies
@rioki
Comment options

@tt4g
Comment options

@rioki
Comment options

@tt4g
Comment options

@rioki
Comment options

Answer selected by rioki
Comment options

You must be logged in to vote
1 reply
@rioki
Comment options

Comment options

You must be logged in to vote
2 replies
@rioki
Comment options

@rioki
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants