[ 22%] Processing OpenCL kernels (video) [ 22%] Processing OpenCL kernels (core) [ 22%] Processing OpenCL kernels (imgproc) [ 22%] Processing OpenCL kernels (photo) [ 22%] Processing OpenCL kernels (features2d) [ 22%] Processing OpenCL kernels (dnn) [ 22%] Processing OpenCL kernels (calib3d) [ 22%] Processing OpenCL kernels (stitching) [ 23%] Processing OpenCL kernels (objdetect) Scanning dependencies of target opencv_world
在wsl2安装的ubuntu系统里面源码编译opencv,在Scanning dependencies of target opencv_world这一步卡住半个小时以及在编译过程中报no matching function for call to google::protobuf等错误。
原因:受到了window的影响,Scanning dependencies在window的系统内进行了查找已经protobuf用的也是window的安装版本导致的。
在 /etc/wsl.conf文件内加入下面几行配置
# 不加载Windows中的PATH内容 [interop] appendWindowsPath = false # 不自动挂载Windows系统所有磁盘分区 [automount] enabled = false
其他配置可参考官方文档:WSL 中的高级设置配置 | Microsoft Learn