error while loading shared libraries: libevent-2.0.so.5解决办法

    xiaoxiao2021-03-25  57

    首先通过下面这个命令查看

    ldd /usr/local/bin/memcached

    第一种情况: libevent-2.0.so.5找不到(这个是网上都可以找到的,我遇到的是第二种情况)

    linux-vdso.so.1 => (0x00007fff6611e000) libevent-2.0.so.5 => not found #查找不到该文件 libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f228c5ff000) libc.so.6 => /lib64/libc.so.6 (0x00007f228c26d000) /lib64/ld-linux-x86-64.so.2 (0x00007f228c82d000)

    解决办法:

    ln -s /usr/local/lib/libevent-2.0.so.5 /lib64/libevent-2.0.so.5 ldd /usr/local/bin/memcached linux-vdso.so.1 => (0x00007fff8e9ff000) libevent-2.0.so.5 => /lib64/libevent-2.0.so.5 (0x00007fe494e34000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fe494c17000) libc.so.6 => /lib64/libc.so.6 (0x00007fe494884000) librt.so.1 => /lib64/librt.so.1 (0x00007fe49467c000) /lib64/ld-linux-x86-64.so.2 (0x00007fe495087000)

    第二种情况: libevent-2.0.so.5有指向的路径,但还是会报这个错 是因为我把libevent的安装路径改掉了,不是默认路径,所以只需要在.bash_profile中添加

    LD_LIBRARY_PATH=$LD_LIBRARY_PATH:libevent的安装路径/lib export LD_LIBRARY_PATH

    添加动态库的查找路径,然后在

    #source .bash_profile

    这样就可以找到libevent-2.0.so.5了

    转载请注明原文地址: https://ju.6miu.com/read-50068.html

    最新回复(0)