zl程序教程

您现在的位置是:首页 >  工具

当前栏目

ORB-SLAM3编译问题 recipe for target ‘CMakeFiles/ORB_SLAM3.dir/src/LocalMapping.cc.o‘ failed

Failed for 编译 Target cc src Dir ORB
2023-09-14 09:09:26 时间
  • 编译 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

  
  
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 解决方法:

添加以下代码到ORB_SLAM3/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()); 
} 
}

  
  
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 如下图

在这里插入图片描述

另外编译时容易卡死,build.sh里make后去掉-j4 -j等多线程选项