进入ch13目录中的源码中使用cmake与make进行编译,在此过程中根据提示安装缺少的依赖项:glog,gtest, g2o等
编译完成后,运行程序./run_kitti_stereo
报错“error while loading shared libraries: libg2o_core.so: cannot open shared object file: No such file or directory”
但是在安装g2o的时候清楚地看到libg2o_core.so被复制到了/usr/local/lib/ 目录下。在其他人的博客中找到了解决方法,需要使用sudo ldconfig
命令更新动态库。
ldconfig
是一个动态链接库管理命令,其目的为了让动态链接库为系统所共享, 通常在系统启动时运行,但是g2o是新安装的库,所以需要手工运行这个命令。
参考博客:
linux中ldconfig的使用介绍
error while loading shared libraries: libg2o_core.so: cannot open shared object file: No such file or directory解决方法