libevent
1.1、libevent简介
是什么 ?:an event notification library which provides a mechanism to execute a callback function when a specific event occurs on a file descriptor or after a timeout has been reached. Furthermore, libevent also support callbacks due to signals or regular timeouts.
开发语言:C
官方主页:https://libevent.org
源码仓库:https://github.com/libevent/libevent
1.2、通过包管理器安装libevent
操作系统包管理器安装命令
Allvcpkg
vcpkg install libevent
vcpkg install libevent:x64-osx
vcpkg install libevent:x64-linux
vcpkg install libevent:x64-windows
macOSHomeBrewbrew install libevent
GNU/LinuxLinuxBrewbrew install libevent
aptsudo apt-get install -y libevent
CentOSyumsudo yum install -y libevent
dnfsudo dnf install -y libevent
openSUSEzyppersudo zypper install -y libevent
Alpine Linuxapksudo apk add libevent

Arch Linux

ArcoLinux

Manjaro Linux

pacmansudo pacman -Syyu --noconfirm
sudo pacman -S    --noconfirm libevent
Gentoo LinuxPortagesudo emerge libevent
1.3、通过编译源码安装libevent 

step1、安装依赖

下载时cURL
解压时targzip
编译时POSIX shGNU CoreUtilsGNU makeGCC ( gcc )   | LLVM / Clang
运行时glibc ( libc.sold-linux-x86-64.so )

step2、使用curl命令下载libevent源码包 (

curl -LO https://github.com/libevent/libevent/releases/download/release-2.1.11-stable/libevent-2.1.11-stable.tar.gz

step3、使用tar解压libevent源码包

tar vxf release-2.1.11-stable.tar.gz

step4、进入libevent-2.1.11-stable目录,并查看它的内容

step5、配置、编译、安装

./configure && make && sudo make install
1.4、libevent中包含的头文件
1.5、libevent中包含的库文件
  • libevent.{a | so | dylib}
  • libevent_core.{a | so | dylib}
  • libevent_extra.{a | so | dylib}
  • libevent_openssl.{a | so | dylib}
  • libevent_pthreads.{a | so | dylib}