-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
#define SPDLOG_LEVEL_NAMES with external FMT doesn't compile, starting from libfmt11. #3233
Comments
This is working, and at least is a better work-around IMO: #include <string_view>
using namespace std::string_view_literals;
#define SPDLOG_LEVEL_NAMES { "TRACE"sv, "DEBUG"sv, "INFO"sv, "NOTICE"sv, "WARNING"sv, "ERROR"sv, "OFF"sv } |
PR is welcome. Note that the “sv” literal is c++17 while spdlog should support 11 |
I would open a PR, but I don't really know what the best approach is for the majority of people. |
I was thinking again on this and realized that this would likely not really be an issue, because the problem only presents when So, most likely for now at least the only thing you really need to change is documenting this option, which could likely be done in the same |
I encountered this issue while compiling the project using C++ 17, and after switching the C++ version to 14 or 20, the compilation was successful. |
* See: gabime/spdlog#3233 * tweakme.h:107:88: error: call to non-‘constexpr’ function * include/spdlog/common-inl.h:19:47: note: in expansion of macro ‘SPDLOG_LEVEL_NAMES’
* See: gabime/spdlog#3233 * tweakme.h:107:88: error: call to non-‘constexpr’ function * include/spdlog/common-inl.h:19:47: note: in expansion of macro ‘SPDLOG_LEVEL_NAMES’
* See: gabime/spdlog#3233 * error 1: * tweakme.h:107:88: error: call to non-‘constexpr’ function * include/spdlog/common-inl.h:19:47: note: in expansion of macro ‘SPDLOG_LEVEL_NAMES’ * error 2: * the value of ‘leftAlign’ is not usable in a constant expression
This came up macOS/apple clang:
Removing the
constexpr
fromstatic string_view_t level_string_views[] SPDLOG_LEVEL_NAMES;
makes it compile, but I don't think this is really the correct fix?The text was updated successfully, but these errors were encountered: