Ubuntu安装ORB-SLAM常见问题

1、error: ‘CV_LOAD_IMAGE_UNCHANGED’ was not declared in this scope

  解决方法:

CV_LOAD_IMAGE_UNCHANGED换成IMREAD_UNCHANGED

并在代码头文件下面添加命名空间using namespace cv;

2、error: ‘usleep’ was not declared in this scope usleep(3000);

解决方案:

在报错的文件里添加头文件#include <unistd.h>

3、

/usr/bin/ld: CMakeFiles/Stereo.dir/src/ros_stereo.cc.o: undefined reference to symbol '_ZN5boost6system15system_categoryEv'

/usr/lib/x86_64-linux-gnu/libboost_system.so: error adding symbols: DSO missing from command line

解决方案:

Cmakelist.txt文件里添加

target_link_libraries(Stereo boost_system boost_filesystem)

4、修改ORB_SLAM2文件夹下的CMakeList.txt文件为

 find_package(OpenCV 4 QUIET)
 if(NOT OpenCV_FOUND)
    find_package(OpenCV 2.4.3 QUIET)
    if(NOT OpenCV_FOUND)
       message(FATAL_ERROR "OpenCV > 2.4.3 not found.")
    endif()
 endif()