Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Header-only version 1.14.0 complie with errors #3080

Closed
l10142720 opened this issue Apr 28, 2024 · 6 comments
Closed

Header-only version 1.14.0 complie with errors #3080

l10142720 opened this issue Apr 28, 2024 · 6 comments

Comments

@l10142720
Copy link

l10142720 commented Apr 28, 2024

1> \code\app\spdlog\fmt\bundled\format-inl.h(61): error C2666: “fmt::v10::format_to”: 2 个重载有相似的转换
1> \code\app\spdlog\fmt\bundled\format.h(4488): note: 可能是“OutputIt fmt::v10::format_to<fmt::v10::appender,fmt::v10::detail::format_error_code::<lambda_e7b6ca30f95e6c0872653af1a0f7e35f>::()::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::<lambda_e7b6ca30f95e6c0872653af1a0f7e35f>::()::FMT_COMPILE_STRING
1> ]
1> \code\app\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> ]
1> \code\app\spdlog\fmt\bundled\format-inl.h(61): note: 尝试匹配参数列表“(fmt::v10::appender, fmt::v10::detail::format_error_code::<lambda_e7b6ca30f95e6c0872653af1a0f7e35f>::()::FMT_COMPILE_STRING, fmt::v10::string_view, const char [3])”时
1> \code\app\spdlog\fmt\bundled\format-inl.h(62): error C2666: “fmt::v10::format_to”: 2 个重载有相似的转换
1> \code\app\spdlog\fmt\bundled\format.h(4488): note: 可能是“OutputIt fmt::v10::format_to<fmt::v10::appender,fmt::v10::detail::format_error_code::<lambda_a71f5db3d62894ebc9138d2d339b7217>::()::FMT_COMPILE_STRING,int&,0>(OutputIt,const Locale &,fmt::v10::basic_format_string<char,int &>,int &)”
1> with
1> [
1> OutputIt=fmt::v10::appender,
1> Locale=fmt::v10::detail::format_error_code::<lambda_a71f5db3d62894ebc9138d2d339b7217>::()::FMT_COMPILE_STRING
1> ]
1> \code\app\spdlog\fmt\bundled\core.h(2861): note: 或 “OutputIt fmt::v10::format_to<fmt::v10::appender,const char(&)[7],int&,0>(OutputIt,fmt::v10::basic_format_string<char,const char (&)[7],int &>,const char (&)[7],int &)”
1> with
1> [
1> OutputIt=fmt::v10::appender
1> ]
1> \code\app\spdlog\fmt\bundled\format-inl.h(62): note: 尝试匹配参数列表“(fmt::v10::appender, fmt::v10::detail::format_error_code::<lambda_a71f5db3d62894ebc9138d2d339b7217>::()::FMT_COMPILE_STRING, const char [7], int)”时
1> \code\app\spdlog\logger-inl.h(139): error C2666: “fmt::v10::format”: 2 个重载有相似的转换
1> \code\app\spdlog\fmt\bundled\format.h(4469): note: 可能是“std::string fmt::v10::format<spdlog::logger::sink_it_::<lambda_1e0e9f55927f4d4ef7dbc2f201ff05d2>::()::FMT_COMPILE_STRING,const char*const &,const int&,0>(const Locale &,fmt::v10::basic_format_string<char,const char const &,const int &>,const char const &,const int &)”
1> with
1> [
1> Locale=spdlog::logger::sink_it_::<lambda_1e0e9f55927f4d4ef7dbc2f201ff05d2>::()::FMT_COMPILE_STRING
1> ]
1> \code\app\spdlog\fmt\bundled\core.h(2833): note: 或 “std::string fmt::v10::format<const char
,const char
const &,const int&>(fmt::v10::basic_format_string<char,const char *,const char *const &,const int &>,const char *&&,const char *const &,const int &)”
1> \code\app\spdlog\logger-inl.h(139): note: 尝试匹配参数列表“(spdlog::logger::sink_it_::<lambda_1e0e9f55927f4d4ef7dbc2f201ff05d2>::()::FMT_COMPILE_STRING, const char *, const char const , const int)”时
1> \code\app\spdlog\logger-inl.h(151): error C2666: “fmt::v10::format”: 2 个重载有相似的转换
1> \code\app\spdlog\fmt\bundled\format.h(4469): note: 可能是“std::string fmt::v10::format<spdlog::logger::flush_::<lambda_6e9a0808e6fb610af80f56ab02a48867>::()::FMT_COMPILE_STRING,const char
&,int&,0>(const Locale &,fmt::v10::basic_format_string<char,const char &,int &>,const char &,int &)”
1> with
1> [
1> Locale=spdlog::logger::flush_::<lambda_6e9a0808e6fb610af80f56ab02a48867>::()::FMT_COMPILE_STRING
1> ]
1> \code\app\spdlog\fmt\bundled\core.h(2833): note: 或 “std::string fmt::v10::format<const char
,const char
&,int&>(fmt::v10::basic_format_string<char,const char *,const char *&,int &>,const char *&&,const char *&,int &)”
1> \code\app\spdlog\logger-inl.h(151): note: 尝试匹配参数列表“(spdlog::logger::flush_::<lambda_6e9a0808e6fb610af80f56ab02a48867>::()::FMT_COMPILE_STRING, const char *, const char *, int)”时

@tt4g
Copy link
Contributor

tt4g commented Apr 28, 2024

There must be some code in your project that failed to compile, and we will not know the cause unless you provide that code.
Please provide the minimum code that can reproduce the problem.

@l10142720
Copy link
Author

There must be some code in your project that failed to compile, and we will not know the cause unless you provide that code. Please provide the minimum code that can reproduce the problem.

template <typename OutputIt, typename Locale, typename... T,
FMT_ENABLE_IF(detail::is_output_iterator<OutputIt, char>::value&&
detail::is_locale::value)>
FMT_INLINE auto format_to(OutputIt out, const Locale& loc,
format_string<T...> fmt, T&&... args) -> OutputIt {
return vformat_to(out, loc, fmt, fmt::make_format_args(args...));
}

template <typename OutputIt, typename... T,
FMT_ENABLE_IF(detail::is_output_iterator<OutputIt, char>::value)>
FMT_INLINE auto format_to(OutputIt out, format_string<T...> fmt, T&&... args)
-> OutputIt {
return vformat_to(out, fmt, fmt::make_format_args(args...));
}

@tt4g
Copy link
Contributor

tt4g commented Apr 29, 2024

It is the source code of the fmt project, not your project's source code and cannot reproduce the problem.

template <typename OutputIt, typename... T,
FMT_ENABLE_IF(detail::is_output_iterator<OutputIt, char>::value)>
FMT_INLINE auto format_to(OutputIt out, format_string<T...> fmt, T&&... args)
-> OutputIt {
return vformat_to(out, fmt, fmt::make_format_args(args...));
}

@l10142720
Copy link
Author

spdlog/include/spdlog/fmt/bundled/core.h

Lines 2859 to 2864 in 238c9ff

template <typename OutputIt, typename... T,
FMT_ENABLE_IF(detail::is_output_iterator<OutputIt, char>::value)>
FMT_INLINE auto format_to(OutputIt out, format_string<T...> fmt, T&&... args)
-> OutputIt {
return vformat_to(out, fmt, fmt::make_format_args(args...));
}

spdlog/include/spdlog/fmt/bundled/format.h

Lines 4485 to 4491 in 238c9ff

template <typename OutputIt, typename Locale, typename... T,
FMT_ENABLE_IF(detail::is_output_iterator<OutputIt, char>::value&&
detail::is_locale::value)>
FMT_INLINE auto format_to(OutputIt out, const Locale& loc,
format_string<T...> fmt, T&&... args) -> OutputIt {
return vformat_to(out, loc, fmt, fmt::make_format_args(args...));
}

\format-inl.h(61): error C2666: “fmt::v10::format_to”

@tt4g
Copy link
Contributor

tt4g commented Apr 29, 2024

That is a template function. The reason you are getting compile errors is because you are failing to materialize the template function.
This issue will not progress unless you have code in your project source code that materializes the template function and you provide it.

@l10142720
Copy link
Author

l10142720 commented Apr 29, 2024

Build with these steps:
1、Copy the include folder to my project
2、include the head file : #include "spdlog.h" in my source file
3、build the source file then report these compile errors

@gabime gabime closed this as completed May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants