美文网首页
Linux下编译成功但是运行显示找不到库的办法

Linux下编译成功但是运行显示找不到库的办法

作者: cc2008cc | 来源:发表于2018-05-29 09:38 被阅读0次

(1 ) Find where the library is placed if you don't know it.

sudo find / -name the_name_of_the_file.so
(2) Check for the existence of the dynamic library path environment variable(LD_LIBRARY_PATH)

$ echo $LD_LIBRARY_PATH
if there is nothing to be displayed, add a default path value (or not if you wish to)

$ LD_LIBRARY_PATH=/usr/local/lib
(3) We add the desire path, export it and try the application.

Note that the path should be the directory where the path.so.something is. So if path.so.something is in /my_library/path.so.something it should be :

$ LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/my_library/
$ export LD_LIBRARY_PATH
$ ./my_app

相关文章

网友评论

      本文标题:Linux下编译成功但是运行显示找不到库的办法

      本文链接:https://www.haomeiwen.com/subject/lzjojftx.html