2016-06-22 59 views
-1

我试图在Centos上安装libevent-2.0.12-stable,但是当我键入sudo make时,发生错误(我在make之前做过./configure):make [2]:*** [libevent.la] Error 1

/bin/sh ./libtool --tag=CC --mode=link gcc -g -O2 -Wall -fno-strict-aliasing -pthread -version-info 6:1:1 -release 2.0 -o libevent.la -rpath /usr/local/libevent-2.0.12-stable/lib event.lo evthread.lo buffer.lo bufferevent.lo bufferevent_sock.lo bufferevent_filter.lo bufferevent_pair.lo listener.lo bufferevent_ratelim.lo evmap.lo log.lo evutil.lo evutil_rand.lo strlcpy.lo select.lo poll.lo epoll.lo signal.lo event_tagging.lo http.lo evdns.lo evrpc.lo -lrt 
libtool: link: gcc -shared -fPIC -DPIC .libs/event.o .libs/evthread.o .libs/buffer.o .libs/bufferevent.o .libs/bufferevent_sock.o .libs/bufferevent_filter.o .libs/bufferevent_pair.o .libs/listener.o .libs/bufferevent_ratelim.o .libs/evmap.o .libs/log.o .libs/evutil.o .libs/evutil_rand.o .libs/strlcpy.o .libs/select.o .libs/poll.o .libs/epoll.o .libs/signal.o .libs/event_tagging.o .libs/http.o .libs/evdns.o .libs/evrpc.o -lrt -O2 -pthread -pthread -Wl,-soname -Wl,libevent-2.0.so.5 -o .libs/libevent-2.0.so.5.1.1 
/usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64/librt.a(clock_gettime.o): relocation R_X86_64_PC32 against undefined symbol `[email protected]@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC 
/usr/bin/ld: final link failed: Bad value 
collect2: ld returned 1 exit status 
make[2]: *** [libevent.la] Error 1 
make[2]: Leaving directory `/home/lpchou/software/httpsqs/libevent-2.0.12-stable' 
make[1]: *** [all-recursive] Error 1 
make[1]: Leaving directory `/home/lpchou/software/httpsqs/libevent-2.0.12-stable' 
make: *** [all] Error 2 

任何人都可以帮忙吗?谢谢。

更新

由@KnudLarsen提到我安装libevent成功后用rpm包,我尝试使用make安装tokyocabinet,但同样的错误发生的情况:

/usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64/libm.a(s_sin.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC 
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64/libm.a: could not read symbols: Bad value 
collect2: ld returned 1 exit status 
make: *** [libtokyocabinet.so.9.10.0] Error 1 

我试着在Recompiling with -fPIC方法,但不起作用。它似乎没有一些依赖包,因为我只是在另一个centos机器上安装libevent和tokyocabinet,一切正常。

+0

?那是CentOS的哪个版本? 'cat etc/redhat-release' ....(CentOS 6.x的libevent版本为1.4.13).. CentOS 6的libevent-2.0.13-14.2.x86_64.rpm在Internet上可用:http:///rpm.pbone.net –

+0

您是否阅读并理解了“用-fPIC重新编译”的部分? – tripleee

+0

@KnudLarsen版本是6.2,我安装了libevent-2.0.13-14.2.x86_64.rpm并且没问题,但是当我安装tokyocabinet时出现同样的问题 – chou

回答

0

的CentOS 6.8 - 64位:

tokyocabinet-1.4.32建立OK:libtokyocabinet.so.8.23.0,libtokyocabinet.a

tokyocabinet - 48年4月1日也行:libtokyocabinet。 so.9.11.0,libtokyocabinet.a

...所以我想你必须安装/重新安装建设要求GCC:

yum reinstall gcc-c++ glibc-devel glibc-headers kernel-headers 

...拥有正确的文件/ usr/lib64 /和/ usr/include /。

?你想要制作哪个版本的tokyocabinet?你从哪里得到它的?



+0

版本是1.4.47,在我重新安装gcc-C++ glibc-devel glibc-headers kernel-headers并尝试重新安装tokyocabinet之后,发生同样的错误。我想这不是版本问题。 – chou

+0

你得到了'/ usr/lib64/libm.so'吗? .....关于1.4.47:这里没有问题。 ... –

+0

当输入'ls -l'时,在/ usr/lib64 /中有libm.so,但它是'../../lib64/libm.so.6'的链接,这是否重要? – chou