问题描述:
./server: error while loading shared libraries: libevent-1.4.so.2: cannot open shared object file: No such file or directory
问题原因:
LD_DEBUG=libs ./server -v > log 2>&1
在所有搜寻路径中,都无法找到libevent-1.4.so.2
问题解决:
1. 搜寻libevent-1.4.so.2 实际路径
spch2008@ubuntu:~/libevent/echo_server$ sudo find / -name libevent-1.4.so.2
/usr/local/lib/libevent-1.4.so.2
2. 在“问题原因”步骤产生的log中,搜寻查找路径
5204: trying file=/usr/lib/libevent-1.4.so.2
3. 创建软连接
cd /usr/local/lib
sudo ln -s /usr/local/lib/libevent-1.4.so.2 <span style="font-family: Arial, Helvetica, sans-serif;">libevent-1.4.so.2</span>