Skip to content
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

ERROR: spdlog error C2338: Cannot format an argument. To make type T formattable provide a formatter<T> specialization: #329

Closed
SpaceView opened this issue Apr 9, 2022 · 4 comments · Fixed by #423
Assignees

Comments

@SpaceView
Copy link

SpaceView commented Apr 9, 2022

Thanks for your bug report. We appreciate it a lot.

win10 + VS2019
I use cmake-gui to generate the solution and then started to compile the file, and got the following problem,
1>------ 已启动生成: 项目: mmdeploy_core, 配置: Debug x64 ------
1>tensor.cpp
1>E:\vOpenMM\mmdeploy\csrc\core/status_code.h(98): warning C4275: 非 dll 接口 class“system_error2::status_code_domain”用作 dll 接口 class“mmdeploy::StatusDomain”的基
1>E:\vOpenMM\mmdeploy\third_party\outcome\outcome-experimental.hpp(6598): note: 参见“system_error2::status_code_domain”的声明
1>E:\vOpenMM\mmdeploy\csrc\core/status_code.h(98): note: 参见“mmdeploy::StatusDomain”的声明
1>E:\vOpenMM\spdlog\include\spdlog/fmt/bundled/core.h(1728): error C2338: Cannot format an argument. To make type T formattable provide a formatter specialization: https://fmt.dev/latest/api.html#udt
1>E:\vOpenMM\spdlog\include\spdlog/fmt/bundled/core.h(1849): note: 查看对正在编译的函数 模板 实例化“fmt::v8::detail::value fmt::v8::detail::make_arg<true,Context,fmt::v8::detail::type::custom_type,mmdeploy::DataType&,0>(T)”的引用
1> with
1> [
1> Context=fmt::v8::format_context,
1> T=mmdeploy::DataType &
1> ]
1>E:\vOpenMM\spdlog\include\spdlog/fmt/bundled/core.h(1871): note: 查看对正在编译的函数 模板 实例化“fmt::v8::format_arg_storefmt::v8::format_context,mmdeploy::DataType,mmdeploy::DataType::format_arg_store<mmdeploy::DataType&,const mmdeploy::DataType&>(mmdeploy::DataType &,const mmdeploy::DataType &)”的引用
1>E:\vOpenMM\spdlog\include\spdlog/fmt/bundled/core.h(1872): note: 查看对正在编译的函数 模板 实例化“fmt::v8::format_arg_storefmt::v8::format_context,mmdeploy::DataType,mmdeploy::DataType::format_arg_store<mmdeploy::DataType&,const mmdeploy::DataType&>(mmdeploy::DataType &,const mmdeploy::DataType &)”的引用
1>E:\vOpenMM\spdlog\include\spdlog/logger.h(357): note: 查看对正在编译的函数 模板 实例化“fmt::v8::format_arg_storefmt::v8::format_context,mmdeploy::DataType,mmdeploy::DataType fmt::v8::make_format_args<fmt::v8::format_context,mmdeploy::DataType&,const mmdeploy::DataType&>(mmdeploy::DataType &,const mmdeploy::DataType &)”的引用
1>E:\vOpenMM\spdlog\include\spdlog/logger.h(89): note: 查看对正在编译的函数 模板 实例化“void spdlog::logger::log_<mmdeploy::DataType&,const mmdeploy::DataType&>(spdlog::source_loc,spdlog::level::level_enum,spdlog::string_view_t,mmdeploy::DataType &,const mmdeploy::DataType &)”的引用
1>E:\vOpenMM\mmdeploy\csrc\core\tensor.cpp(99): note: 查看对正在编译的函数 模板 实例化“void spdlog::logger::log<mmdeploy::DataType&,const mmdeploy::DataType&>(spdlog::source_loc,spdlog::level::level_enum,fmt::v8::basic_format_string<char,mmdeploy::DataType &,const mmdeploy::DataType &>,mmdeploy::DataType &,const mmdeploy::DataType &)”的引用
1>registry.cpp
1>E:\vOpenMM\mmdeploy\csrc\core/status_code.h(98): warning C4275: 非 dll 接口 class“system_error2::status_code_domain”用作 dll 接口 class“mmdeploy::StatusDomain”的基
1>E:\vOpenMM\mmdeploy\third_party\outcome\outcome-experimental.hpp(6598): note: 参见“system_error2::status_code_domain”的声明
1>E:\vOpenMM\mmdeploy\csrc\core/status_code.h(98): note: 参见“mmdeploy::StatusDomain”的声明
1>stacktrace.cpp
1>正在生成代码...
1>已完成生成项目“mmdeploy_core.vcxproj”的操作 - 失败。

currently I'm not sure whether this is a spdlog problem or a mmdeploy problem or both.
the only thing I'm sure is that this error is raised by the following sentence, in tensor.cpp.

MMDEPLOY_ERROR("mismatched data type {} vs {}", desc_.data_type, tensor.desc().data_type);

My temporary fix is make them integer,

MMDEPLOY_ERROR("mismatched data type {} vs {}", (int)desc_.data_type, (int)tensor.desc().data_type);

any better idea, please?

@lvhan028
Copy link
Collaborator

lvhan028 commented Apr 9, 2022

Can you share your way to build and install spdlog?

@xinsuinizhuan
Copy link

I meet the same error.

@irexyc
Copy link
Collaborator

irexyc commented Apr 21, 2022

The spdlog v1.9.2 should work.

@lvhan028
Copy link
Collaborator

@lzhangzz it seems mmdeploy failed to integrate the latest spdlog. Please investigate this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants