libipopt.so.1: Cannot open shared object file

拈花ヽ惹草 提交于 2019-12-06 11:00:42

问题


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

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

I've defined $LD_LIBRARY_PATH in .bashrc, and I've confirmed that ls $LD_LIBRARY_PATH shows libipopt.so and libipopt.so.l


回答1:


You need to export the environment variable after setting it.

Try

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.



来源:https://stackoverflow.com/questions/37974827/libipopt-so-1-cannot-open-shared-object-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!