Open askraskr opened 5 months ago
It may be that the definition of the fmt custom formatter refers to an older document (https://fmt.dev/8.0.0/api.html#formatting-user-defined-types).
The fmt 10 documentation gives auto
as the return type, but example.cpp
gives decltype(ctx.out())
. The two types are probably incompatible.
In fmt 10 document (https://fmt.dev/10.2.0/api.html#formatting-user-defined-types):
#include <fmt/core.h>
enum class color {red, green, blue};
template <> struct fmt::formatter<color>: formatter<string_view> {
// parse is inherited from formatter<string_view>.
auto format(color c, format_context& ctx) const;
};
Since it is example
that is failing to build, you can work around the problem with -DSPDLOG_BUILD_EXAMPLE=OFF
.
Just installed and test fmt library (development version) with the following instructions:
It's working perfectly fine.
But I wanted my
spdlog
library to not use the bundledfmt
, so I usedSPDLOG_FMT_EXTERNAL
option with the following command:But when I tried to build it, I got this error.
No matter what compiler (gcc) version or C++ standard I use, I get the same error. What is the problem?