diff --git a/include/spdlog/details/backtracer.h b/include/spdlog/details/backtracer.h index cf813fe6..60b6022b 100644 --- a/include/spdlog/details/backtracer.h +++ b/include/spdlog/details/backtracer.h @@ -43,4 +43,6 @@ public: #ifdef SPDLOG_HEADER_ONLY #include "backtracer-inl.h" +#else +extern template class spdlog::details::circular_q; #endif \ No newline at end of file diff --git a/include/spdlog/sinks/base_sink.h b/include/spdlog/sinks/base_sink.h index be3956a7..53ba40f0 100644 --- a/include/spdlog/sinks/base_sink.h +++ b/include/spdlog/sinks/base_sink.h @@ -13,6 +13,7 @@ #include "spdlog/details/log_msg.h" #include "spdlog/sinks/sink.h" + namespace spdlog { namespace sinks { template @@ -43,4 +44,9 @@ protected: #ifdef SPDLOG_HEADER_ONLY #include "base_sink-inl.h" +#else +#include "spdlog/details/null_mutex.h" +#include +extern template class spdlog::sinks::base_sink; +extern template class spdlog::sinks::base_sink; #endif diff --git a/src/file_sinks.cpp b/src/file_sinks.cpp index 48adeb3c..bc23f8d5 100644 --- a/src/file_sinks.cpp +++ b/src/file_sinks.cpp @@ -6,16 +6,10 @@ #endif #include -#include "spdlog/sinks/base_sink.h" #include "spdlog/details/null_mutex.h" - #include "spdlog/details/file_helper-inl.h" -#include "spdlog/sinks/base_sink-inl.h" - -template class spdlog::sinks::base_sink; -template class spdlog::sinks::base_sink; - #include "spdlog/sinks/basic_file_sink-inl.h" + template class spdlog::sinks::basic_file_sink; template class spdlog::sinks::basic_file_sink; diff --git a/src/spdlog.cpp b/src/spdlog.cpp index 662b5ac4..aed0e48a 100644 --- a/src/spdlog.cpp +++ b/src/spdlog.cpp @@ -15,8 +15,15 @@ #include "spdlog/details/log_msg_buffer-inl.h" #include "spdlog/logger-inl.h" #include "spdlog/sinks/sink-inl.h" - +#include "spdlog/sinks/base_sink-inl.h" +#include "spdlog/details/null_mutex.h" + +#include + // template instantiate logger constructor with sinks init list template spdlog::logger::logger(std::string name, sinks_init_list::iterator begin, sinks_init_list::iterator end); +template class spdlog::details::circular_q; +template class spdlog::sinks::base_sink; +template class spdlog::sinks::base_sink; template class fmt::basic_string_view; template class fmt::basic_memory_buffer; \ No newline at end of file