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: static assertion failed: Cannot format an argument. To make type T formattable provide a formatter<T> specialization: #6

Closed
xkungxfu opened this issue Aug 31, 2023 · 1 comment

Comments

@xkungxfu
Copy link

xkungxfu commented Aug 31, 2023

/// Finds the main video stream in the current device context.
int DeviceContext::find_main_stream(AVMediaType streamType) {
  // Build method params for error handling purposes
  std::map<std::string, std::string> methodParams = {
      {"streamType", std::to_string(streamType)}};

  if (avfc == nullptr) {
    throw std::runtime_error(Error::build_error_message(
        __FUNCTION__, methodParams, "device not initialized"));
  }

  int streamIndex =
      av_find_best_stream(avfc.get(), streamType, -1, -1, nullptr, 0);
  if (streamIndex < 0) {
    throw std::runtime_error(Error::build_error_message(
        __FUNCTION__, methodParams,
        fmt::format("error finding main stream for type {}", streamType)));
  }

  return streamIndex;
}


device_context.cpp:152:21: In template: call to deleted constructor of 'formatter<mapped_type, char_type>' (aka 'formatter<AVMediaType, char>')
core.h:2567:10: error occurred here
core.h:2626:23: in instantiation of function template specialization 'fmt::detail::parse_format_specs<AVMediaType, fmt::detail::compile_parse_context<char>>' requested here
core.h:2775:47: in instantiation of member function 'fmt::detail::format_string_checker<char, AVMediaType>::format_string_checker' requested here
device_context.cpp:152:21: in instantiation of function template specialization 'fmt::basic_format_string<char, AVMediaType &>::basic_format_string<char[38], 0>' requested here
core.h:792:3: 'formatter' has been explicitly marked deleted here

/vcpkg-2023.06.20/packages/fmt_x64-windows/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,
@MarcoBramini
Copy link
Owner

MarcoBramini commented Oct 2, 2023

Sadly the fmt library got updated and i didn't set a specific version in the install commands.
I will address this as soon as i have time to! Thanks for letting me know.

This seems to be related to #5. I'm closing this one and leave the other open for any follow-up.

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

No branches or pull requests

2 participants