gpt4 book ai didi

windows - 无法找到基于Windows的OpenSSL依赖关系构建

转载 作者:行者123 更新时间:2023-12-03 11:10:32 31 4
gpt4 key购买 nike

我正在尝试使用cmake 3.15.2在Windows 10上编译带有openssl的restbed。

我按照here提供的说明进行操作

因此,请按照以下步骤安装openssl:

cd restbed\dependency\openssl
perl Configure shared VC-WIN64A
nmake
nmake test
nmake install

然后,我用cmake建立卧床:
cmake -G "Visual Studio 15 2017 Win64" -DBUILD_EXAMPLES=YES -DBUILD_TESTS=YES ..

但是我总是以这个错误结束:
CMake Error at cmake/Findopenssl.cmake:23 (message):
Failed to locate OpenSSL dependency. see restbed/dependency/openssl;
./config shared; make all
Call Stack (most recent call first):
CMakeLists.txt:49 (find_package)

尽管在我的config命令中使用了 shared

我调查了Findopenssl.cmake,发现搜索到的大多数文件都丢失了。
find_library( ssl_LIBRARY_STATIC libssl.a  ssleay32.lib HINTS "${PROJECT_SOURCE_DIR}/dependency/openssl/out32dll" "${PROJECT_SOURCE_DIR}/dependency/openssl" "/usr/local/opt/openssl/lib" "/usr/lib" "/usr/local/lib" "/opt/local/lib" )
find_library( crypto_LIBRARY_STATIC libcrypto.a libeay32.lib HINTS "${PROJECT_SOURCE_DIR}/dependency/openssl/out32dll" "${PROJECT_SOURCE_DIR}/dependency/openssl" "/usr/local/opt/openssl/lib" "/usr/lib" "/usr/local/lib" "/opt/local/lib" )

find_library( ssl_LIBRARY_SHARED libssl.so libssl.dylib ssleay32.dll HINTS "${PROJECT_SOURCE_DIR}/dependency/openssl/out32dll" "${PROJECT_SOURCE_DIR}/dependency/openssl" "/usr/local/opt/openssl/lib" "/usr/lib" "/usr/local/lib" "/opt/local/lib" )
find_library( crypto_LIBRARY_SHARED libcrypto.so libcrypto.dylib libeay32.dll HINTS "${PROJECT_SOURCE_DIR}/dependency/openssl/out32dll" "${PROJECT_SOURCE_DIR}/dependency/openssl" "/usr/local/opt/openssl/lib" "/usr/lib" "/usr/local/lib" "/opt/local/lib" )

find_path( ssl_INCLUDE openssl/ssl.h HINTS "${PROJECT_SOURCE_DIR}/dependency/openssl/inc32" "${PROJECT_SOURCE_DIR}/dependency/openssl/include" "/usr/local/opt/openssl/include" "/usr/include" "/usr/local/include" "/opt/local/include" )

此外,它们大多数似乎是linux路径。

我四处搜索,发现 this question确实很相似,但是在debian而不是Windows上工作。
我没有设法找到我的openssl安装中缺少的内容。

知道这里可能缺少什么吗?

谢谢 !

最佳答案

我找到了问题的根源及其解决方案。

这是the answer

由于openssl更改了libcrypto.liblibssl.lib的库,因此当前的Findopenssl.cmake找不到所需的内容:libeay32.lib和`ssleay32.lib。

我没有通过仅更改find_library中的名称来使其工作,所以我只是注释了这些并添加了这两行Findopenssl.cmake:

set(ssl_LIBRARY_SHARED "${PROJECT_SOURCE_DIR}/dependency/openssl")
set(crypto_LIBRARY_SHARED "${PROJECT_SOURCE_DIR}/dependency/openssl")

这有点脏,但能创造奇迹。

关于windows - 无法找到基于Windows的OpenSSL依赖关系构建,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57787207/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com