Emulator Issues #13318
closedCompiling Dolphin: "static assertion failed: Cannot format an argument." when using fmt 10.0.0
0%
Description
What's the problem? Describe what went wrong.
Dolphin fails to compile on the latest git commit f2b8baa82cf78f3b3bb5a58995dd31e235ca31de
when using the latest fmt release (10.0.0
) with this error:
[ 40%] Building CXX object Source/Core/VideoCommon/CMakeFiles/videocommon.dir/XFStructs.cpp.o
[ 41%] Building CXX object Source/Core/VideoCommon/CMakeFiles/videocommon.dir/VertexLoaderX64.cpp.o
[ 41%] Building CXX object Source/Core/VideoCommon/CMakeFiles/videocommon.dir/FrameDumpFFMpeg.cpp.o
In file included from /usr/include/fmt/format.h:49,
from /usr/include/fmt/os.h:20,
from /home/user/dolphin/Source/Core/VideoCommon/Assets/DirectFilesystemAssetLibrary.cpp:7:
/usr/include/fmt/core.h: In instantiation of ‘constexpr fmt::v10::detail::value<Context> fmt::v10::detail::make_value(T&&) [with Context = fmt::v10::basic_format_context<fmt::v10::appender, char>; T = const std::error_code&]’:
/usr/include/fmt/core.h:1711:29: required from ‘constexpr fmt::v10::detail::value<Context> fmt::v10::detail::make_arg(T&&) [with bool IS_PACKED = true; Context = fmt::v10::basic_format_context<fmt::v10::appender, char>; type <anonymous> = fmt::v10::detail::type::custom_type; T = const std::error_code&; typename std::enable_if<IS_PACKED, int>::type <anonymous> = 0]’
/usr/include/fmt/core.h:1827:77: required from ‘constexpr fmt::v10::format_arg_store<Context, Args>::format_arg_store(T&& ...) [with T = {const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, const std::error_code&}; Context = fmt::v10::basic_format_context<fmt::v10::appender, char>; Args = {std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::error_code}]’
/usr/include/fmt/core.h:1844:31: required from ‘constexpr fmt::v10::format_arg_store<Context, typename std::remove_cv<typename std::remove_reference<_Args>::type>::type ...> fmt::v10::make_format_args(T&& ...) [with Context = basic_format_context<appender, char>; T = {const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, const std::error_code&}]’
/home/user/dolphin/Source/Core/Common/Logging/Log.h:101:75: required from ‘void Common::Log::GenericLogFmt(LogLevel, LogType, const char*, int, const S&, const Args& ...) [with long unsigned int NumFields = 2; S = VideoCommon::DirectFilesystemAssetLibrary::LoadPixelShader(const VideoCommon::CustomAssetLibrary::AssetID&, VideoCommon::PixelShaderData*)::<lambda()>::FMT_COMPILE_STRING; Args = {std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::error_code}]’
/home/user/dolphin/Source/Core/VideoCommon/Assets/DirectFilesystemAssetLibrary.cpp:86:7: required from here
/usr/include/fmt/core.h:1691:7: error: static assertion failed: Cannot format an argument. To make type T formattable provide a formatter<T> specialization: https://fmt.dev/latest/api.html#udt
1691 | formattable,
| ^~~~~~~~~~~
/usr/include/fmt/core.h:1691:7: note: ‘formattable’ evaluates to false
However if I downgrade to fmt 9.1.0
it starts to compile without problems and that error doesn't appear
What steps will reproduce the problem?
- git clone the latest commit available at the date of this issue:
f2b8baa82cf78f3b3bb5a58995dd31e235ca31de
- Compile Dolphin
What are your PC specifications? (CPU, GPU, Operating System, more)
- i7-11850K
- Arch Linux
- 16GiB of RAM
Is there anything else that can help developers narrow down the issue? (e.g. logs, screenshots,
configuration files, savefiles, savestates)
I wasn't able to fully compile Dolphin because of the lack of RAM but I'm sure that this compilation error doesn't apply when using fmt 9.1.0
. Here are the targets compiled before I couldn't go further than that because I don't have enough RAM.
[ 0%] Built target bdisasm
[ 0%] Built target cpp-optparse
[ 1%] Built target xxhash
[ 1%] Built target FatFs
[ 2%] Built target SoundTouch
[ 2%] Built target FreeSurround
[ 2%] Built target imgui
[ 4%] Built target rcheevos
[ 6%] Built target minizip
[ 6%] Built target unittests_stubhost
[ 10%] Built target glslang
[ 10%] Built target gtest
[ 11%] Built target discord-rpc
[ 11%] Built target implot
[ 11%] Built target unittests_main
[ 11%] Built target dolphin_scmrev
[ 18%] Built target common
[ 18%] Built target traversal_server
[ 19%] Built target audiocommon
[ 21%] Built target uicommon
[ 26%] Built target inputcommon
[ 28%] Built target videovulkan
[ 29%] Built target videosoftware
[ 29%] Built target videonull
[ 31%] Built target videoogl
[ 41%] Built target videocommon
[ 44%] Built target discio