gabime / spdlog

Fast C++ logging library.
Other
24.58k stars 4.58k forks source link

1.15.0 build error on vs2017 #3264

Closed 346536971 closed 3 days ago

346536971 commented 1 week ago

build a win32 project (MBCS Mode), error happen : " static_assert(!FMT_UNICODE || use_utf8(), "Unicode support requires compiling with /utf-8"); " why ? the FMT support windows?

tt4g commented 1 week ago

fmt questions must be asked in the fmt repository to be answered by the fmt maintainer. You should move this issue to fmt.

tt4g commented 1 week ago

At least the /utf-8 option is missing: https://github.com/fmtlib/fmt/issues/4221#issuecomment-2448640358

gabime commented 1 week ago

If you consume spdlog using cmake, the flag should have been already added for you. How do you use spdlog?

stanirya commented 1 week ago

I had the same issue before on 1.14.1, try this workaround:

add_compile_options("$<$<C_COMPILER_ID:MSVC>:/utf-8>")
add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/utf-8>")
346536971 commented 1 week ago

If you consume spdlog using cmake, the flag should have been already added for you. How do you use spdlog? build only include