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
vs编译工作正常, g++编译报错 #3082
Comments
Can you write problems in English? |
As you wish |
The compiler prints the macro as the cause of the error, but I don't know if the code is really the cause. Can you provide the code from your project where the problem occurred (the minimal code that can reproduce the problem)? |
use once in the code after initialization windows build run ok, linux build error, I don't know if it's a compiler issue |
This is a well-known problem that occurs when using In other words, your macro is resolved as follows: // Before
s_info("hello");
// After
SPDLOG_LOGGER_INFO(multi_logger, fmt, );;
There are workarounds, such as |
use spdlog header-only
vs2022 ok,g++ 9.3.0 build error
spdlog-1.14.0/include/spdlog/spdlog.h:296:98: error: expected primary-expression before )' token
296 | (logger)->log(spdlog::source_loc{FILE, LINE, SPDLOG_FUNCTION}, level, VA_ARGS)
| ^
need help
ps:
SPDLOG_LOGGER_INFO(logger, "hello"); ==> SPDLOG_LOGGER_INFO(logger, "hello", 0);
then g++ ok
The text was updated successfully, but these errors were encountered: