安装libevent

1.在libevent官网(http://libevent.org/)上下载压缩包(我下载的是libevent-2.1.8-stable.tar.gz)

2.解压压缩包:tar -zxvf libevent-2.1.8-stable.tzr.gz

3.进入新生成的目录中:cd libevent-2.1.8-stable

4.配置安装库的目标路径:./configure --prefix=/usr

报错:configure: error: openssl is a must but can not be found. You should add the directory containing ‘openssl.pc’ to the PKG_CONFIG_PATH’ environment variable, or set ‘CFLAGS’ and ‘LDFLAGS’ directly for openssl, or use ‘–disable-openssl’ to disable support for openssl encryption
运行:sudo apt install libssl-dev
5.编译安装libevent库:(1)make (2)sudo make install

6.检测安装是否成功:ls -al /usr/lib | grep libevent

posted @ 2022-02-06 14:13  hellozhangjz  阅读(685)  评论(0)    收藏  举报