-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Unable to compile spdlog with GCC #2825
Comments
This is fmt library issue and already fixed fmtlib/fmt#3137. |
Thank you, but - why spdlog doesn't have fixed version? |
This is because the API is broken because fmt 10 removed the feature to use However, you can use latest fmt with the CMake variable Lines 91 to 92 in d8d23a6
|
In my build process I set it up like this to use a non-bundled version of fmt and build spdlog with fetchContent, leaving this here in case its useful to anyone:
|
On any GCC version (12/13/14), I cannot compile spdlog. I'm using FreeBSD 12 (x86) and I tried compile simple code, but:
spdlog/fmt/bundled/format.h: In instantiation of 'constexpr int fmt::v9::detail::format_float(Float, int, float_specs, buffer&) [with Float = long double]':
spdlog/fmt/bundled/format.h:3230:25: required from 'constexpr OutputIt fmt::v9::detail::write(OutputIt, T, fmt::v9::basic_format_specs, locale_ref) [with Char = char; OutputIt = fmt::v9::appender; T = long double; typename std::enable_if<std::integral_constant<bool, (std::is_floating_point::value || std::is_same<T, __float128>::value)>::value, int>::type = 0]'
spdlog/fmt/bundled/format.h:3394:25: required from 'constexpr fmt::v9::detail::arg_formatter::iterator fmt::v9::detail::arg_formatter::operator()(T) [with T = long double; Char = char; iterator = fmt::v9::appender]'
spdlog/fmt/bundled/core.h:1649:15: required from 'constexpr decltype (vis(0)) fmt::v9::visit_format_arg(Visitor&&, const basic_format_arg&) [with Visitor = detail::arg_formatter&; Context = basic_format_context<appender, char>; decltype (vis(0)) = appender]'
spdlog/fmt/bundled/format.h:4132:42: required from 'const Char* fmt::v9::detail::vformat_to(buffer&, fmt::v9::basic_string_view, fmt::v9::basic_format_args<fmt::v9::basic_format_context<typename std::conditional<std::is_same<typename fmt::v9::type_identity::type, char>::value, fmt::v9::appender, std::back_insert_iterator<buffer<typename fmt::v9::type_identity::type> > >::type, typename fmt::v9::type_identity::type> >, locale_ref)::format_handler::on_format_specs(int, const Char*, const Char*) [with Char = char]'
spdlog/fmt/bundled/format.h:4135:3: required from 'void fmt::v9::detail::vformat_to(buffer&, fmt::v9::basic_string_view, fmt::v9::basic_format_args<fmt::v9::basic_format_context<typename std::conditional<std::is_same<typename fmt::v9::type_identity::type, char>::value, fmt::v9::appender, std::back_insert_iterator<buffer<typename fmt::v9::type_identity::type> > >::type, typename fmt::v9::type_identity::type> >, locale_ref) [with Char = char; typename std::conditional<std::is_same<typename fmt::v9::type_identity::type, char>::value, fmt::v9::appender, std::back_insert_iterator<buffer<typename fmt::v9::type_identity::type> > >::type = fmt::v9::appender; typename fmt::v9::type_identity::type = char]'
spdlog/fmt/bundled/format-inl.h:1472:21: required from here
spdlog/fmt/bundled/format.h:3122:20: error: invalid use of incomplete type 'struct fmt::v9::detail::dragonbox::float_info<long double, void>'
3122 | const auto f = basic_fp(converted_value);
spdlog/fmt/bundled/format.h:1289:54: note: declaration of 'struct fmt::v9::detail::dragonbox::float_info<long double, void>'
1289 | template <typename T, typename Enable = void> struct float_info;
When I switch compiler to llvm (17), everything compiles well (on Windows also).
CXX_STANDARD 20
spdlog v1.x branch/1.12.0
The text was updated successfully, but these errors were encountered: