[英]OpenSSL in Qt5 on Windows
我正在尝试将 openssl 与 qt5.12 链接,但是从 qt 和命令行运行可执行文件时结果不同。 我使用 QSslSocket::supportsSsl()、QSslSocket::sslLibraryVersionString() 和 QSslSocket::sslLibraryBuildVersionString() 来观察结果。 When running exe from qt i get the following output respectively true
OpenSSL 1.1.1d 10 Sep 2019
OpenSSL 1.1.1k 25 Mar 2021
and for command line false
""
OpenSSL 1.1.1k 25 Mar 2021
. 该 exe 使用 msvc 2017 64 位编译。 可能是什么问题,qt 从哪里获得该库?
使用 listdlls 工具,我设法找到了 openssl DLL 的名称和位置。 它们是libssl-1_1-x64.dll
和libcrypto-1_1-x64.dll
并位于%QT_INSTALL_PATH%/Tools/QtCreator/bin
。 将这些 DLL 复制到项目的构建文件夹解决了这个问题。
QtCreator 使用的构建环境显然是默认环境,可以在Projects -> Run
中找到。 它设置了许多环境变量,就我而言,它更新了PATH
变量,添加了 QtCreator bin 文件夹的路径。
Qt doesn't ship SSL libraries by default, you need to install them manually, to be sure that you have compatible SSL libraries Install OpenSSL XXX Toolkit
from Qt Maintenance Tool then in <Qt directory>/Tools/OpenSSL
you will find your OpenSSL packages与二进制文件。
In order to fully ship Windows Qt application to the end-users, please study https://doc.qt.io/qt-5/windows-deployment.html closely
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.