加载共享库时出错:libboost_program_options.so.1.65.1

时间:2018-05-14 22:07:48

标签: c++ linux boost

我正在使用一个名为dawg的程序,它依赖于boost库。我需要在没有root访问权限的群集上运行程序。在尝试运行程序时,它返回错误:

/home/masih/Baterial_simulator/dawg_new/my_build/bin/dawg: error while loading shared libraries: libboost_program_options.so.1.65.1: cannot open shared object file: No such file or directory

我手动安装了boost 1.65.1软件包并将其放在'.bashrc'文件中,如下所示:

#export LD_LIBRARY_PATH="/home/masih/Baterial_simulator/boost_1_65_1/lib/lib:$LD_LIBRARY_PATH"

'/ home / masih / Baterial_simulator / boost_1_65_1 / lib / lib'中存在'libboost_program_options.so.1.65.1'文件但仍然出现错误。

我还尝试在配置包时添加boost包信息,方法是在'CMakeLists.txt'中添加以下行

SET (BOOST_ROOT "/home/masih/Baterial_simulator/boost_1_65_1/lib")
SET (BOOST_INCLUDEDIR "/home/masih/Baterial_simulator/boost_1_65_1/lib/include")
SET (BOOST_LIBRARYDIR "/home/masih/Baterial_simulator/boost_1_65_1/lib/lib")

安装完成没有任何错误但尝试运行程序再次返回相同的错误。 群集正在使用RedHat OS。

1 个答案:

答案 0 :(得分:1)

提供运行程序的目录路径。

例如:
下面的行将指向库路径到您当前/程序目录 如果已经设置,则使用:unset LD_LIBRARY_PATH

export LD_LIBRARY_PATH=/home/masih/Baterial_simulator/dawg_new/my_build/bin/dawg:$LD_LIBRARY_PATH

注意:此命令仅在系统lib路径中安装libboost_program_options.so.1.65.1时有效。
如果不工作,则将库路径指向正在运行的程序的路径。

 export LD_LIBRARY_PATH=/home/masih/Baterial_simulator/boost_1_65_1/lib/lib:/home/masih/Baterial_simulator/dawg_new/my_build/bin/dawg
相关问题