问题:找不到软件包“ libcrypto”

时间:2020-03-30 06:45:37

标签: c++ cmake openssl libcrypto

我看到了此问题“找不到软件包'libcrypto'”。我几个月前解决的同一错误是遵循以下解决方案:https://github.com/scipr-lab/libsnark/issues/99 我今天尝试了此解决方案,但是它不再起作用。 (我也尝试过“ brew install openssl,brew info openssl”)运气不好。 您以前看过吗?你能帮忙看看吗?

-- Checking for module 'libcrypto'
--   No package 'libcrypto' found
CMake Error at /usr/local/Cellar/cmake/3.15.4/share/cmake/Modules/FindPkgConfig.cmake:458 (message):
  A required package was not found
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.15.4/share/cmake/Modules/FindPkgConfig.cmake:637 (_pkg_check_modules_internal)
  PlaylistParser/src/CMakeLists.txt:2 (pkg_check_modules)


-- Configuring incomplete, errors occurred!

1 个答案:

答案 0 :(得分:5)

brew info openssl说:(对我来说,如果您的版本不同,对您来说可能会有所不同)

openssl@1.1 is keg-only, which means it was not symlinked into /usr/local,
because openssl/libressl is provided by macOS so don't link an incompatible version.

If you need to have openssl@1.1 first in your PATH run:
  echo 'export PATH="/usr/local/opt/openssl@1.1/bin:$PATH"' >> ~/.zshrc

For compilers to find openssl@1.1 you may need to set:
  export LDFLAGS="-L/usr/local/opt/openssl@1.1/lib"
  export CPPFLAGS="-I/usr/local/opt/openssl@1.1/include"

For pkg-config to find openssl@1.1 you may need to set:
  export PKG_CONFIG_PATH="/usr/local/opt/openssl@1.1/lib/pkgconfig"

由于您的CMake脚本似乎使用pkg-config,因此您只需要在运行cmake之前执行最后一条语句即可。