Skip to content

Use of designated initializers fails Windows build #5874

Open
@definability

Description

@definability

OS Platform and Distribution

Windows 11

Compiler version

MSVC 19.29.30158 for x64

Programming Language and version

C++17

Installed using virtualenv? pip? Conda?(if python)

No

MediaPipe version

master (ffe429d)

Bazel version

6.5.0

XCode and Tulsi versions (if iOS)

N/A

Android SDK and NDK versions (if android)

N/A

Android AAR (if android)

None

OpenCV version (if running on desktop)

3.4.12

Describe the problem

Build of hand_tracking_cpu example fails

bazel-6.5.0 build --verbose_failures -c opt --define MEDIAPIPE_DISABLE_GPU=1 --define=xnn_enable_avxvnniint8=false --shell_executable="C:\msys64\usr\bin\bash.exe" --repo_env=HERMETIC_PYTHON_VERSION=3.11 -- //mediapipe/examples/desktop/hand_tracking:hand_tracking_cpu

The problem was introduced in

monitoring_info_vector.emplace_back(OutputStreamMonitoringInfo(
{.stream_name = DebugStreamName(id),
.num_packets_added = stream->NumPacketsAdded(),
.next_timestamp_bound = stream->NextTimestampBound()}));
}

Designated initializers are a feature of C++20: https://en.cppreference.com/w/cpp/language/aggregate_initialization.

I see two ways to fix this problem, but I am unsure about the MediaPipe team's plans.

  1. Do not use designated initializers.
  2. Update the C++ version to C++20. This may require updating the codebase accordingly, and people using older compilers may have problems with it.

Complete Logs

All you need to know:

mediapipe/framework/output_stream_handler.cc(146): error C7555: use of designated initializers requires at least '/std:c++20'

Metadata

Metadata

Assignees

Labels

legacy:handsHand tracking/gestures/etcos:windowsMediaPipe issues on Windowsplatform:c++Issues specific to C++ framework in mediapipetype:build/installFor Build and Installation issues

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions