Ubuntu编译生成libevent库
文章目录
- 下载libevent
配置
2.1 ./configure --prefix=/usr/lib/libevent
报错如下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 encryption2.2 解决方法:
需要配置环境变量PKG_CONFIG_PATH为openssl.pc的路径,Ubuntu已经装了openssl,但是找不到openssl.pc,原因是没有安装 libssl-dev。
输入命令: sudo apt install -y libssl-dev 后安装后可以找到openssl.pc的路径:/usr/lib/x86_64-linux-gnu/pkgconfig/openssl.pc2.3 配置环境变量PKG_CONFIG_PATH后,2.1的命令可以执行成功
- 编译
1) make
2) sudo make install - 查看结果
ll /usr/lib/libevent
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论