mediapipe bazel build 编译提示编译找不到opencv4/opencv2/core/version.hpp

问题:mediapipe bazel build 编译提示编译找不到opencv4/opencv2/core/version.hpp
分析:主要原因在于没有配置好bazel的第三方库的环境变量
解决方案:
1、需要修改根目录下WORKSAPCE的linux_opencv仓库的path,改到你安装的opencv环境位置,例如我安装opencv4需要修改如下

new_local_repository(
    name = "linux_opencv",
    build_file = "@//third_party:opencv_linux.BUILD",
    path = "/home/myname/software/opencv",
)

2、需要修改third_party/opencv_linux.BUILD找到opencv

cc_library(
    name = "opencv",
    srcs = glob(
        [
            "lib/libopencv_core.so",
            "lib/libopencv_highgui.so",
            "lib/libopencv_imgcodecs.so",
            "lib/libopencv_imgproc.so",
            "lib/libopencv_video.so",
            "lib/libopencv_videoio.so",
        ],
    ),
    hdrs = glob(["include/opencv4/opencv2/*.h*",
   "include/opencv4/opencv2/**/*.h*" , ]),
    includes = ["include/opencv4/"],
    linkstatic = 1,
    visibility = ["//visibility:public"],
)

你可能感兴趣的:(我爱Debug)