foreword
Install libevent network library under CentOS7
step
①Create a folder libevent (to facilitate later maintenance and management)
mkdir ~/libevent
②Download the source code package from the official website
You can download it locally and then transfer the file, or you can download it directly on linux (direct linux download is recommended, which is convenient and fast)
Libevent official website: https://libevent.org/
wget 下载链接
③ Unzip the source package
tar -zxvf *.tar.gz(源码包)
After decompression, enter the source package folder directory
View the README.md file,
In the source package folder
If the following error is encountered during ./configure (solution: 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
make compile
make install install
At this point, the installation of libevent is complete, and you can conduct sample experiments in ./sample by yourself