前言
CentOS7下安装libevent网络库
步骤
①创建一个文件夹libevent(方便后期维护管理)
mkdir ~/libevent
②官网下载源码包
可以在本机下载然后文件传输,也可以直接在linux下载(推荐直接linux下载,方便快捷)
libevent官网:https://libevent.org/
wget 下载链接
③解压源码包
tar -zxvf *.tar.gz(源码包)
解压完毕后,进入到源码包文件夹目录下
![](https://img-blog.csdnimg.cn/270d061451b44aa5b2a25ab1d72be23d.png)
查看README.md文件,
![](https://img-blog.csdnimg.cn/c898518d4cae4146bd45afc34af66dc9.png)
在源码包文件夹下
./configure 过程中如遇到如下错误(解决:yum install -y openssl openssl-devel)
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
![](https://img-blog.csdnimg.cn/ad7f7ebee8e64f17a64fa934f73321d7.png)
make 编译
make install 安装
至此libevent安装完成,可自行在./sample中进行样例实验
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)