编译ORBSlam2的时遇到的问题

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/chishuideyu/article/details/77189561

编译ORBSlam2的时遇到的问题

找不到usleep函数

 error: ‘usleep’ was not declared in this scope

解决方法
在system.h头文件前,加入#include <unistd.h>

#ifndef SYSTEM_H
#define SYSTEM_H

#include <unistd.h> //添加
#include<string>

无法查找到DBOW2的库未定义的引用

/usr/bin/ld: warning: libopencv_core.so.3.2, needed by ../Thirdparty/DBoW2/lib/libDBoW2.so, not found (try using -rpath or -rpath-link)
../lib/libORB_SLAM2.so:对‘DBoW2::FORB::toString[abi:cxx11](cv::Mat const&)’未定义的引用
../lib/libORB_SLAM2.so:对‘DBoW2::FORB::fromString(cv::Mat&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)’未定义的引用
collect2: error: ld returned 1 exit status
CMakeFiles/mono_kitti.dir/build.make:157: recipe for target '../Examples/Monocular/mono_kitti' failed
make[2]: *** [../Examples/Monocular/mono_kitti] Error 1
CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/mono_kitti.dir/all' failed
make[1]: *** [CMakeFiles/mono_kitti.dir/all] Error 2

解决方法
删除Thirdparty下的DBOW2下的build文件夹,重新运行build.sh,重新进行编译。

猜你喜欢

转载自blog.csdn.net/chishuideyu/article/details/77189561