赞
踩
在编译高博的视觉SLAM十四讲ch8的optical_flow.cpp
时,编译报错:
CMake Error at CMakeLists.txt:8 (find_package):
Could not find a configuration file for package "OpenCV" that is compatible
with requested version "4".
The following configuration files were considered but not accepted:
/usr/local/share/OpenCV/OpenCVConfig.cmake, version: 3.4.16
-- Configuring incomplete, errors occurred!
在第八讲的这个程序里,CMakeLists.txt
中编译find_package
查找的是OpenCV4,而十四讲前面使用的opencv包括自己编译的都是opencv3版本,所以编译过程找不到相应的库文件以及链接,报错。
简单粗暴,虽然opencv版本不同,但是3到4大部分接口函数都是一样的,所以在CMakeLists.txt
中将查找OpenCV4改为查找OpenCV3:
# find_package(OpenCV 4 REQUIRED)
find_package(OpenCV 3 REQUIRED)
然后就可以编译成功了。由于安装的Sophus版本或者G2o版本过高,还可能会出现fmt::v8
的链接问题,解决方案在这里。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。