Error: ‘fmt::v11::detail::type_is_unformattable_for<XTP_POSITION_DIRECTION_TYPE, char> _’ has incomplete type when using spdlog headers
System Archlinux x64 GCC 14.2.1 cmake 3.31.5
Spdlog
I use git clone get latest version
Bug details Error occurred when I compile another project which need spdlog headers. The cmake result is:
......
***.cpp:495:33: required from here
495 | std::string key = fmt::format("{}-{}", code.c_str(), position->position_direction);
/git/spdlog/include/spdlog/fmt/bundled/base.h:2235:45: error: ‘fmt::v11::detail::type_is_unformattable_for<XTP_POSITION_DIRECTION_TYPE, char> _’ has incomplete type
2235 | type_is_unformattable_for<T, char_type> _;
Please provide code to reproduce and compiler info
Please provide code to reproduce and compiler info
I'm sorry that I'm not a c++ expert/daily user, and I'd not use spdlog before. So I need more time to study and write a POC.
I had this issue a little bit ago. For me, I noticed it was an error related to passing a std::filesystem::path as an argument. So, as a workaround/fix, I just got the c_str() from the path instead. I assume its something similar in your case @shilkazx
See https://fmt.dev/11.1/api/#std-api , spdlog uses fmt under the hood, and fmt by default doesn't include support for everything to reduce compile times. #include <fmt/std.h> before spdlog fixed this for me.