编译 ORBSLAM3 时遇到的报错,没有其他提示。ubuntu18.04
CMakeFiles/ORB_SLAM3.dir/build.make:110: recipe for target 'CMakeFiles/ORB_SLAM3.dir/src/LocalMapping.cc.o' failed
make[2]: *** [CMakeFiles/ORB_SLAM3.dir/src/LocalMapping.cc.o] Error 1
CMakeFiles/Makefile2:289: recipe for target 'CMakeFiles/ORB_SLAM3.dir/all' failed
make[1]: *** [CMakeFiles/ORB_SLAM3.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
解决方法:
添加以下代码到ORB_SLAM3-master/include/CameraModels/KannalaBrandt8.h
namespace cv
{
template<typename _Tp, int m, int n> static inline Matx<_Tp, m, n> operator / (const Matx<_Tp, m, n>& a, float alpha)
{
return Matx<_Tp, m, n>(a, 1.f / alpha, Matx_ScaleOp());
}
}
如下图
另外编译时容易卡死,build.sh里make后去掉-j4 -j等多线程选项