找不到 OpenSSL ...缺少:OPENSSL_CRYPTO_LIBRARY

发布于 2025-01-12 19:10:38 字数 1071 浏览 3 评论 0原文

我正在尝试交叉编译 aws-sdk-cpp,但在第一次运行 CMAKE 时出现以下错误。如果我第二次运行它,它会编译并链接,并且我已经测试了该应用程序,并且我确实可以使用 aws-sdk-cpp 功能。我已经搜索了好几天并尝试了各种事情:

  • 为 OPENSSL_ROOT_DIR 设置环境变量
  • 将其设置在 cmake 变量中,等等。

我在调用之前打印 OPENSSL_ROOT_DIR 变量

find_package(OpenSSL REQUIRED) 

,它打印正确的内容小路。

我还将变量 OPENSSL_USE_STATIC_LIBS 设置为 TRUE,没有任何区别。 老实说,我不明白发生了什么,因为如果我第二次运行它,它就会构建和链接得很好。

CMake Error at /snap/cmake/1035/share/cmake-3.22/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) (found version "1.1.1n")
Call Stack (most recent call first):
  /snap/cmake/1035/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
  /snap/cmake/1035/share/cmake-3.22/Modules/FindOpenSSL.cmake:574 (find_package_handle_standard_args)
  Projects/libraries/aws/s3/crt/aws-crt-cpp/crt/aws-c-cal/CMakeLists.txt:89 (find_package)

I am trying to cross-compile the aws-sdk-cpp and I am getting the following error just the very first time I run CMAKE. If I run it a second time it compiles and links and I have tested the application and I can indeed use the aws-sdk-cpp functionality. I have searched and searched for days and tried all kinds of things:

  • Setting environment variable for OPENSSL_ROOT_DIR
  • Setting it in a cmake variable, etc.

I print the OPENSSL_ROOT_DIR variable right before the call to

find_package(OpenSSL REQUIRED) 

and it prints the right PATH.

I have also set the variable OPENSSL_USE_STATIC_LIBS to TRUE without any difference.
I honestly don't understand what is going on since if I run it a second time it builds and links just fine.

CMake Error at /snap/cmake/1035/share/cmake-3.22/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) (found version "1.1.1n")
Call Stack (most recent call first):
  /snap/cmake/1035/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
  /snap/cmake/1035/share/cmake-3.22/Modules/FindOpenSSL.cmake:574 (find_package_handle_standard_args)
  Projects/libraries/aws/s3/crt/aws-crt-cpp/crt/aws-c-cal/CMakeLists.txt:89 (find_package)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

各自安好 2025-01-19 19:10:38

好吧,我已经知道发生了什么事。

问题是我正在设置“

OPENSSL_INCLUDE_DIR
OPENSSL_CRYPTO_LIBRARY
OPENSSL_SSL_LIBRARY

一旦删除它们”的值,它就起作用了。

Ok so I have figured what was going on.

the issue was that I was setting the values for

OPENSSL_INCLUDE_DIR
OPENSSL_CRYPTO_LIBRARY
OPENSSL_SSL_LIBRARY

Once I deleted them it worked.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文