Linker error compiling MediaPipe face detection on Windows
jlouw2 opened this issue · 15 comments
Environment:
OS: Windows 11
Compiler: Visual Studio 2022
Programming language: C++, 64-bit build
Bazel version 5.3.2
OpenCV version 3.4.16
Python version 3.10
Build command:
bazel build -c opt --define MEDIAPIPE_DISABLE_GPU=1 --action_env PYTHON_BIN_PATH="C://Program Files//Python310//python.exe" mediapipe/examples/desktop/face_detection:face_detection_cpu
Problem:
face_detection_options_registry.lo.lib(face_detection_options_lib.obj) : error LNK2019: unresolved external symbol "private: static class RegistrationToken::RegistrationToken const mediapipe::tool::OptionsRegistry::registration_token" (??$registration_token@VFaceDetectionOptions@mediapipe@@@OptionsRegistry@tool@mediapipe@@0VRegistrationToken@3@B) referenced in function "??__E?$registration_token@VFaceDetectionOptions@mediapipe@@@OptionsRegistry@tool@mediapipe@@yaxxz" (??__E?$registration_token@VFaceDetectionOptions@mediapipe@@@OptionsRegistry@tool@mediapipe@@yaxxz)
inference_calculator_options_registry.lo.lib(inference_calculator_options_lib.obj) : error LNK2019: unresolved external symbol "private: static class RegistrationToken::RegistrationToken const mediapipe::tool::OptionsRegistry::registration_token" (??$registration_token@VInferenceCalculatorOptions@mediapipe@@@OptionsRegistry@tool@mediapipe@@0VRegistrationToken@3@B) referenced in function "??__E?$registration_token@VInferenceCalculatorOptions@mediapipe@@@OptionsRegistry@tool@mediapipe@@yaxxz" (??__E?$registration_token@VInferenceCalculatorOptions@mediapipe@@@OptionsRegistry@tool@mediapipe@@yaxxz)
bazel-out\x64_windows-opt\bin\mediapipe\examples\desktop\face_detection\face_detection_cpu.exe : fatal error LNK1120: 2 unresolved externals
Hi @jlouw2,
MediaPipe team has not tested any solution which is available on Windows11 and running MediaPipe on Windows is still experimental as mentioned here. If you succeed in building the MediaPipe in Windows11 it will be instructions to other users. Thank you!
Hi @kuaashish,
I will test on Windows 10, but I doubt that Windows 11 is the problem. The fact that everything compiles and that there are only 2 linker errors points to Bazel missing a library. I tried adding --subcommands --verbose_failures , but that did not help me to find the problem. hello_world compiled fine. On Ubuntu (22.04 and 22.10) I got multiple compilation errors, long before getting to linking. Which Linux distro and versions of software have been validated to work?
Hi @jlouw2,
Mediapipe has been tested on the ubuntu version mentioned in the guide here. Could you follow the documentation and let us know the issue still persists on the mentioned version.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you.
Closing as stale. Please reopen if you'd like to work on this further.