您的位置:首页 > 移动开发 > Objective-C

error while loading shared libraries: so: cannot open shared object file: No such file or directory

2018-03-15 16:27 2246 查看
利用LD_DEBUG=libs解决找不到文件的问题,通常情况都是在系统路径下没有对应的文件,那么这个命令就能够发现缺少的文件,并且能看到查找的路径

[root@localhost tmux-2.6]# tmux -V
tmux: error while loading shared libraries: libevent-2.1.so.6: cannot open shared object file: No such file or directory

[root@localhost tmux-2.6]# [b]LD_DEBUG=libs [/b]tmux -V | grep libevent
     54283:     find library=libutil.so.1 [0]; searching
     54283:      search cache=/etc/ld.so.cache
     54283:       trying file=/lib64/libutil.so.1
     54283:
     54283:     find library=libevent-2.1.so.6 [0]; searching
     54283:      search cache=/etc/ld.so.cache
     54283:      search path=/lib64/tls/x86_64:/lib64/tls:/lib64/x86_64:/lib64:/usr/lib64/tls/x86_64:/usr/lib64/tls:/usr/lib64/x86_64:/usr/lib64                (system search path)
     54283:       trying file=/lib64/tls/x86_64/libevent-2.1.so.6
     54283:       trying file=/lib64/tls/libevent-2.1.so.6
     54283:       trying file=/lib64/x86_64/libevent-2.1.so.6
     54283:       trying file=/lib64/libevent-2.1.so.6
     54283:       trying file=/usr/lib64/tls/x86_64/libevent-2.1.so.6
     54283:       trying file=/usr/lib64/tls/libevent-2.1.so.6
     54283:       trying file=/usr/lib64/x86_64/libevent-2.1.so.6
     54283:       trying file=/usr/lib64/libevent-2.1.so.6
     54283:
tmux: error while loading shared libraries: libevent-2.1.so.6: cannot open shared object file: No such file or directory
找到缺少的文件位置
[root@localhost tmux-2.6]# ll /usr/local/tmux/lib/libevent-2.1.so.6

lrwxrwxrwx. 1 root root 21 Mar 16 00:05 /usr/local/tmux/lib/libevent-2.1.so.6 -> libevent-2.1.so.6.0.2
做个软连接到系统路径下
[root@localhost tmux-2.6]# ln -s /usr/local/tmux/lib/libevent-2.1.so.6 /usr/lib64/libevent-2.1.so.6
这样就能找到缺少的文件了:
[root@localhost tmux-2.6]# tmux -V
tmux 2.6
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐