关于ubuntu-server:Ubuntu编译生成libevent库

33次阅读

共计 578 个字符,预计需要花费 2 分钟才能阅读完成。

  1. 下载 libevent
  2. 配置
    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 encryption

    2.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.pc

    2.3 配置环境变量 PKG_CONFIG_PATH 后,2.1 的命令能够执行胜利

  3. 编译
    1) make
    2) sudo make install
  4. 查看后果
    ll /usr/lib/libevent

正文完
 0