无法运行 bazel build 命令

问题描述

我正在尝试使用 bazel 执行 Handtracking android 应用程序,当我运行构建命令时出现此错误

你能帮我修一下吗

ERROR: C:/users/admin/mediapipe_repo/mediapipe/mediapipe/framework/formats/BUILD:251:24: C++ compilation of rule '//mediapipe/framework/formats:landmark_cc_proto' Failed (Exit 1): clang fai
led: error executing command external/androidndk/ndk/toolchains/llvm/prebuilt/windows-x86_64/bin/clang -gcc-toolchain external/androidndk/ndk/toolchains/aarch64-linux-android-4.9/prebuilt/w
indows-x86_64 -target ... (remaining 57 argument(s) skipped)
clang: error: no such file or directory: '/w'
clang: error: no such file or directory: '/D_USE_MATH_DEFInes'
clang: error: no such file or directory: '/std:c++17'
Target //mediapipe/examples/android/src/java/com/google/mediapipe/apps/handtrackinggpu:handtrackinggpu Failed to build
Use --verbose_failures to see the command lines of Failed build steps.
INFO: Elapsed time: 151.344s,Critical Path: 132.86s
INFO: 160 processes: 128 internal,31 local,1 worker.
Failed: Build did NOT complete successfully

解决方法

Mediapipe 文档中有 a note

注意:在本机 Windows 上仍然无法构建 MediaPipe Android 应用程序。请改为在 WSL 中执行此操作,并参阅下一节中的 WSL 设置说明。

这意味着您正在尝试做的事情目前是不可能的,抱歉。另请参阅 this issue 了解与您情况相同的其他人。