我在我的源代码中使用 libevent,编译程序后,我运行它,我得到以下错误:
./my_program: error while loading shared libraries: libevent-1.4.so.2: cannot open shared
以前我对如何安装 libevent 和安装类似libverto-libevent-0.2.5-1.fc16.x86_64.rpm
. 无论如何,最后我编译并安装了libevent源代码./configure, make and make install
,但它安装在/usr/lib
while/usr/lib64
被之前的残留.so文件占用,如下:
[esolve@kity lib]$ ls /usr/lib64|grep "libevent"
libevent-2.0.so.5
libevent-2.0.so.5.0.1
libevent_core-2.0.so.5
libevent_core-2.0.so.5.0.1
libevent_extra-2.0.so.5
libevent_extra-2.0.so.5.0.1
libevent_openssl-2.0.so.5
libevent_openssl-2.0.so.5.0.1
libevent_pthreads-2.0.so.5
libevent_pthreads-2.0.so.5.0.1
libeventviews.so.4
libeventviews.so.4.8.0
[esolve@kity lib]$ ls /usr/lib|grep "libevent"
libevent-1.4.so.2
libevent-1.4.so.2.2.0
libevent.a
libevent_core-1.4.so.2
libevent_core-1.4.so.2.2.0
libevent_core.a
libevent_core.la
libevent_core.so
libevent_extra-1.4.so.2
libevent_extra-1.4.so.2.2.0
libevent_extra.a
libevent_extra.la
libevent_extra.so
libevent.la
libevent.so
[esolve@kity lib]$
我该怎么做才能成功运行 ./my_program ?我的系统是fedora 16,我要链接libevent-1.4.so
谢谢!
顺便提一句:
我试过rpm -e all previous-wrongly-installed rpm package,有一些“该包未安装”的提示,我得到了
[esolve@kity lib]$ ls /usr/lib64|grep "libevent"
lrwxrwxrwx 1 root root 21 Apr 3 2012 libevent-2.0.so.5 -> libevent-2.0.so.5.0.1
-rwxr-xr-x 1 root root 280720 Feb 9 2011 libevent-2.0.so.5.0.1
lrwxrwxrwx 1 root root 26 Apr 3 2012 libevent_core-2.0.so.5 -> libevent_core-2.0.so.5.0.1
-rwxr-xr-x 1 root root 165760 Feb 9 2011 libevent_core-2.0.so.5.0.1
lrwxrwxrwx 1 root root 27 Apr 3 2012 libevent_extra-2.0.so.5 -> libevent_extra-2.0.so.5.0.1
-rwxr-xr-x 1 root root 127400 Feb 9 2011 libevent_extra-2.0.so.5.0.1
lrwxrwxrwx 1 root root 29 Apr 3 2012 libevent_openssl-2.0.so.5 -> libevent_openssl-2.0.so.5.0.1
-rwxr-xr-x 1 root root 21352 Feb 9 2011 libevent_openssl-2.0.so.5.0.1
lrwxrwxrwx 1 root root 30 Apr 3 2012 libevent_pthreads-2.0.so.5 -> libevent_pthreads-2.0.so.5.0.1
-rwxr-xr-x 1 root root 6992 Feb 9 2011 libevent_pthreads-2.0.so.5.0.1
lrwxrwxrwx 1 root root 22 Jul 31 2012 libeventviews.so.4 -> libeventviews.so.4.8.0
-rwxr-xr-x 1 root root 974656 Jul 9 2012 libeventviews.so.4.8.0