首页 > 解决方案 > centos ./configure error: libevent not found 尽管它是通过 yum 安装的

问题描述

我有一个非常奇怪的问题。我正在尝试编译一个依赖于 openssl、libevent 和其他库的源 (telegram-cli)。

系统是centos 6.9,通过yum安装“开发工具”和libevent-devel和openssl-devel。顺便说一句, ./configure 会产生以下输出:

使用这个 repo ( Telegram-CLI ):

git clone --recursive https://github.com/vysheng/tg.git && cd tg

。/配置 :

checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for library containing clock_gettime... no
checking for library containing backtrace... no
checking for event_base_new in -levent... no
configure: error: no libevent found

gcc -v -N :

Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.4.7 20120313 (Red Hat 4.4.7-18) (GCC)

我还将它添加到 /etc/ld.so.conf.d/ :

/usr/lib64
/usr/lib
/usr/local/lib64
/usr/local/lib
/lib
/lib64
/usr/lib64/openssl/engines
/usr/lib64/libevent-1.4.so.2.1.3
/usr/lib64/libgcrypt.so
/usr/lib64/libevent.so

奇怪的是,所有这些配置在另一个 centos 系统上都是一样的,而且一切正常。:(

我猜系统上存在这些库,但 gcc 或链接器找不到它们。任何人都可以帮忙吗?谢谢

标签: gccopenssltelegramautoconflibevent

解决方案


你需要libevent-devel

yum install libevent-devel

推荐阅读