Skip to content

how to share spdlog in libraries and main function? #3171

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

You must be logged in to vote

In C++, declaring a static variable in a class declaration creates a copy of the same variable in all modules that include the header file.
Do not declare static variables in the class body.
It is safe to declare static variables in class functions written in cpp files.

Replies: 1 comment 8 replies

Comment options

You must be logged in to vote
8 replies
@tt4g
Comment options

@tt4g
Comment options

@gakki2019
Comment options

@tt4g
Comment options

Answer selected by gakki2019
@gakki2019
Comment options

@gakki2019
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
2 participants