原创

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

安装libevent时候configure是抛出openssl错误:

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

file

解决:

提示非常明显了,未找到openssl,

  1. 设置PKG_CONFIG_PATH使其能找到openssl。
  2. 设置CFLAGS与LDFLAGS值指定openssl位置。
  3. 通过--disable-openssl禁用openssl。

这里通过第二种指定位置:

./configure --prefix=/usr/local CFLAGS="-I/Users/weilai/openssl/include" LDFLAGS="-L/Users/weilai/openssl/lib"
正文到此结束
本文目录