diff --git a/include/spdlog/common.h b/include/spdlog/common.h index 146f035b..432ac624 100644 --- a/include/spdlog/common.h +++ b/include/spdlog/common.h @@ -100,12 +100,7 @@ using log_clock = std::chrono::system_clock; using sink_ptr = std::shared_ptr; using sinks_init_list = std::initializer_list; using err_handler = std::function; - -template -using basic_string_view_t = fmt::basic_string_view; - -using string_view_t = basic_string_view_t; - +using string_view_t = fmt::basic_string_view; using memory_buf_t = fmt::basic_memory_buffer; #ifdef SPDLOG_WCHAR_TO_UTF8_SUPPORT @@ -248,4 +243,7 @@ std::unique_ptr make_unique(Args &&... args) #ifdef SPDLOG_HEADER_ONLY #include "common-inl.h" +#else +extern template class fmt::basic_string_view; +extern template class fmt::basic_memory_buffer; #endif diff --git a/src/spdlog.cpp b/src/spdlog.cpp index ef22d1b2..662b5ac4 100644 --- a/src/spdlog.cpp +++ b/src/spdlog.cpp @@ -18,3 +18,5 @@ // 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 fmt::basic_string_view; +template class fmt::basic_memory_buffer; \ No newline at end of file