g2o error2

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

在默认情况下,编译器只会使用/lib和/usr/lib这两个目录下的库文件,通过源码包进行安装时,如果不指定--prefix会将库安装在/usr/local目录下,而又没有在文件/etc/ld.so.conf中添加 /usr/local/lib这个目录。这样虽然安装了源码包,但是使用时仍然找不到相关的.so库,就会报错。也就是说系统不知道安装了源码包。网络上的解决方法是在/etc/ld.so.conf里添加绝对路径/usr/local/lib.

在该文件中直接另起一行,直接写路径。/usr/local/lib

最后将修改写入缓存!!

sudo ldconfig

posted @ 2018-02-21 23:13  Awecoder  阅读(2049)  评论(0编辑  收藏  举报