libipopt.so.1:无法打开共享对象文件 [英] libipopt.so.1: Cannot open shared object file
问题描述
在执行 Ipopt 的基本安装后,我可以在 Ipopt-3.12.5 / Ipopt / examples / hs071_cpp
中使用命令
Upon performing the basic installation of Ipopt, I'm able to compile the example they provided in Ipopt-3.12.5/Ipopt/examples/hs071_cpp
successfully using the command
g++ hs_071_main.cpp hs071_nlp.cpp -I/path/to/build/include/coin -L/path/to/build/lib -lipopt -llapack -lblas -lm -ldl
但是当我尝试运行 ./ a.out
,我收到错误:
But when I try to run ./a.out
, I get the error:
error while loading shared libraries:
libipopt.so.1: cannot open shared object file: No such file or directory
我已经定义了 $ LD_LIBRARY_PATH
在 .bashrc
中,我已经确认 ls $ LD_LIBRARY_PATH
显示 libipopt.so
和 libipopt.so.l
I've defined $LD_LIBRARY_PATH
in .bashrc
, and I've confirmed that ls $LD_LIBRARY_PATH
shows libipopt.so
and libipopt.so.l
推荐答案
您需要在设置环境变量后导出。
You need to export the environment variable after setting it.
尝试
export LD_LIBRARY_PATH=/whatever/path/you/want:/any/more/pathes/here:/and/here
默认情况下设置更好使用
When setting this by default better use
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/your/personal/so/lib/path1:/path2
这样你就不会覆盖可能已经设置的任何系统范围的搜索路径。
This way you do not overwrite any system wide search paths which might already have been set.
这篇关于libipopt.so.1:无法打开共享对象文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!