高性能I/O框架库Libevent
1. 编译过程中出现的问题
问题一:"Could NOT find OpenSSL"
CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the
system variable OPENSSL_ROOT_DIR (missing: OPENSSL_CRYPTO_LIBRARY
OPENSSL_INCLUDE_DIR)
Call Stack (most recent call first):
/usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-3.16/Modules/FindOpenSSL.cmake:570 (find_package_handle_standard_args)
CMakeLists.txt:899 (find_package)
解法方式
sudo apt-get install libssl-dev
另外,如果安装openssl-dev
时,提示如上图所示的信息,则需要先运行以下命令,再安装openssl-dev
sudo apt-get install libssl1.1=1.1.1-1ubuntu2.1~18.04.14
问题二: "Could NOT find MbedTLS"
CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find MbedTLS (missing: MBEDTLS_INCLUDE_DIR MBEDTLS_LIBRARY
MBEDTLS_CRYPTO_LIBRARY MBEDTLS_X509_LIBRARY MBEDTLS_LIBRARIES
MBEDTLS_VERSION)
Call Stack (most recent call first):
/usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
cmake/FindMbedTLS.cmake:127 (find_package_handle_standard_args)
CMakeLists.txt:914 (find_package)
解决方式
# 按照以下命令进行编译
mkdir build && cd build
cmake -DEVENT__DISABLE_MBEDTLS=ON ..
make
make install