BUG(跑slam14-ch6-g2o)

安装g2o依赖项:

1.安装依赖项

 sudo apt-get install libqt4-dev qt4-qmake libqglviewer-dev libsuitesparse-dev libcxsparse3.1.2 libcholmod-dev

// 根据14讲书,注:最后一个依赖项需要table键来填充名称
// 可以参考此配置大全,因为我的也是2.1.2
https://blog.csdn.net/felaim/article/details/60138647

2.下载并安装

git clone https://github.com/RainerKuemmerle/g2o
cd g2o
mkdir build
cd build
cmake ..
sudo make install

卸载重新安装:

由于g2o默认安装在usr\local\bin,usr\local\include,usr\local\lib三个文件夹中,
故卸载时需要分别进入进入这三个文件夹,在终端输入

sudo rm -rf *g2o*

重新安装的过程同上

BUG处理

not providing “FindG2O.cmake” in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by “G2O”,but CMakedid not find one.

原因及解决:
定义了CMAKE_MODULE_PATH但是没有相应的文件夹和文件,所以应该有新建一个包含FindG2O.cmake文件的文件夹CMAKE_MODULE_PATH,该文件夹和build文件夹并列放在该项目文件夹中。

参考:https://blog.csdn.net/github_38704428/article/details/78522374

error:no matching function for call to‘g2o::BlockSolver>::BlockSolver(g2o::BlockSolver >::LinearSolverType*&)’

代码书写问题,参考:
https://blog.csdn.net/qq_40313712/article/details/84953112
https://blog.csdn.net/weixin_38358435/article/details/79082733
https://blog.csdn.net/handsome_for_kill/article/details/53288771
对g2o的理解和学习(基于slamEng.cpp)

error:while loading shared libraries: libg2o_core.so: cannot open shared object file: No such file or directory

参考:https://blog.csdn.net/icameling/article/details/78400413
https://blog.csdn.net/icameling/article/details/78400413

error:stray‘\343’in program

// 可能程序本身的语法没有问题,但是,出错行中包含不被识别的字符,比如空格的格式不对;
// 将程序中出错行前面的空格删除,重新插入空格或tab键,重新编译,错误消失。

你可能感兴趣的:(视觉SLAM十四讲,g2o,slam14)