so.:cannot open shared object file: No such file or directory

在安装好yaml使用时,cmakelist文件添加如下配置:

find_package(yaml-cpp REQUIRED)

target_link_libraries(yaml_parameter_node yaml-cpp)

但是总是显示:error while loading shared libraries: libyaml-cpp.so.0.7: cannot open shared object file: No such file or directory。在我的/usr/local/lib文件夹下面有对应的lib库。

找到如下:

如果共享文件安装到了/usrl/ocal/lib (很多开源的共享库都会安装到该目录下)或其他“非/lib或/usrlib”目录下,那么在执行ldconfig命令前,还要把新共享库目录加入到共享库配置文件/etc/ld.so.conf中,如下:

#cat /etc/ld.so.conf

在文件中添加:include ld.so.conf.d/*.conf

#echo "/usr/local/lib">>/etc/ld.so.conf

#sudo ldconfig

你可能感兴趣的:(linux,ubuntu)