gabime / spdlog

Fast C++ logging library.
Other
23.64k stars 4.44k forks source link

compiler error on vs2015 #3134

Closed Xuhuajie-2021 closed 1 month ago

Xuhuajie-2021 commented 1 month ago

include "spdlog\spdlog.h"

When I include head file in VS2015, it turns wrong with below:

1>d:\project_master\02_user_client_tools\trunk\thirdparty\include\spdlog\fmt\bundled\format-inl.h(61): error C2666: “fmt::v10::format_to”: 2 个重载有相似的转换 1> d:\project_master\02_user_client_tools\trunk\thirdparty\include\spdlog\fmt\bundled\format.h(4488): note: 可能是“OutputIt fmt::v10::format_to<fmt::v10::appender,fmt::v10::detail::format_error_code::::()::FMT_COMPILE_STRING,const char(&)[3],0>(OutputIt,const Locale &,fmt::v10::basic_format_string<char,const char (&)[3]>,const char (&)[3])” 1> with 1> [ 1> OutputIt=fmt::v10::appender, 1> Locale=fmt::v10::detail::format_error_code::::()::FMT_COMPILE_STRING 1> ] 1> d:\project_master\02_user_client_tools\trunk\thirdparty\include\spdlog\fmt\bundled\core.h(2861): note: 或 “OutputIt fmt::v10::format_to<fmt::v10::appender,fmt::v10::string_view&,const char(&)[3],0>(OutputIt,fmt::v10::basic_format_string<char,fmt::v10::string_view &,const char (&)[3]>,fmt::v10::string_view &,const char (&)[3])” 1> with 1> [ 1> OutputIt=fmt::v10::appender 1> ]

tt4g commented 1 month ago

Please write your issue in English so that many people can read your issue.

tt4g commented 1 month ago

Template materialization has failed. It should not be caused by just including spdlog, so there must be code in your project that caused the error. We will not be able to help you unless you submit the code that is causing the error.

Xuhuajie-2021 commented 1 month ago

I checkout the master version, it works. the default version '1.x' ,compiler error. my code is here:

include

include

include "spdlog\spdlog.h"

int main() {

system("pause");

}

tt4g commented 1 month ago

I found a report of C2666 in the fmt repository fmtlib/fmt#3469, but unfortunately MSVC2015 is no longer supported. Please use a newer version MSVC.

Xuhuajie-2021 commented 1 month ago

thanks for reply.