ORBSLAM2与OPENCV3.1.0出错解决办法

用opencv3.1.0做ORBSLAM2运行一下命令时
cd ORB_SLAM2
chmod +x build.sh
./build.sh
出错:/usr/bin/ld: CMakeFiles/mono_tum.dir/Examples/Monocular/mono_tum.cc.o: undefined reference to symbol '_ZN2cv6String10deallocateEv'
/usr/local/lib/libopencv_core.so.3.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
解决办法:因为该ORBSLAM2程序时用OPENCV2.4.X写的,所以用opencv3.1.0时要改一下依赖包
具体做法:Instead of installing opencv again, just edit the cmakelists.txt (all) and remove version number written i.e. 2.4 from the OPENCV REQUIRED line.
即将ORBSLAM2文件夹下的CMakeLists.txt中的find_package(OpenCV 2.4.3 REQUIRED)改写成find_package(OpenCV 3.0.0 REQUIRED),再运行
./build.sh
即可.
上一篇:dbm数据库


下一篇:Linux常用基本命令:三剑客命令之-awk格式化动作