Qt,WIndows和OpenSSL - 无法调用未解析的函数xyz

时间:2017-11-01 22:57:11

标签: qt openssl arcgis

我最近在运行Qt 5.9.1的Windows 10计算机上安装了ArcGIS Runtime SDK。尝试使用其中一个ArcGIS模板构建简单的QWidget应用程序时,出现以下错误:

qt.network.ssl: QSslSocket: cannot call unresolved function SSLv23_client_method
qt.network.ssl: QSslSocket: cannot call unresolved function SSL_CTX_new
qt.network.ssl: QSslSocket: cannot call unresolved function SSL_library_init
qt.network.ssl: QSslSocket: cannot call unresolved function ERR_get_error
qt.network.ssl: QSslSocket: cannot call unresolved function ERR_get_error
qt.network.ssl: QSslSocket: cannot call unresolved function SSLv23_client_method
qt.network.ssl: QSslSocket: cannot call unresolved function SSL_CTX_new
qt.network.ssl: QSslSocket: cannot call unresolved function SSL_library_init
qt.network.ssl: QSslSocket: cannot call unresolved function ERR_get_error
qt.network.ssl: QSslSocket: cannot call unresolved function ERR_get_error
qt.network.ssl: QSslSocket: cannot call unresolved function SSLv23_client_method
qt.network.ssl: QSslSocket: cannot call unresolved function SSL_CTX_new
qt.network.ssl: QSslSocket: cannot call unresolved function SSL_library_init
qt.network.ssl: QSslSocket: cannot call unresolved function ERR_get_error
qt.network.ssl: QSslSocket: cannot call unresolved function ERR_get_error
qt.network.ssl: QSslSocket: cannot call unresolved function SSLv23_client_method
qt.network.ssl: QSslSocket: cannot call unresolved function SSL_CTX_new
qt.network.ssl: QSslSocket: cannot call unresolved function SSL_library_init
qt.network.ssl: QSslSocket: cannot call unresolved function ERR_get_error
qt.network.ssl: QSslSocket: cannot call unresolved function ERR_get_error
qt.network.ssl: QSslSocket: cannot call unresolved function SSLv23_client_method
qt.network.ssl: QSslSocket: cannot call unresolved function SSL_CTX_new
qt.network.ssl: QSslSocket: cannot call unresolved function SSL_library_init
qt.network.ssl: QSslSocket: cannot call unresolved function ERR_get_error
qt.network.ssl: QSslSocket: cannot call unresolved function ERR_get_error

这个问题似乎很常见,但大多数Google搜索结果都为Linux系统提供了答案。

我做了以下事情:

  • 下载并安装了OpenSSL(来自GnuWin32 OpenSSL)
  • libeay32.dlllibssl32.dll复制到构建文件夹
  • 在Qt专业文件中添加了包含路径
  • 已验证network位于专业文件的QT +=配置部分

然而,上述情况都没有任何区别。我正在运行MSVC 2015 32位套件。

2 个答案:

答案 0 :(得分:1)

您必须将静态库添加到项目中。

找出libeay32.liblibssl32.lib并将其添加到您的项目中。

参见

http://doc.qt.io/qtcreator/creator-project-qmake-libraries.html

答案 1 :(得分:0)

我认为您需要两个dll文件:libeay32.dll和ssleay32.dll。我使用与您相同的qt版本,因此您可以从here下载它们,也可以直接从{{3 }}(对我有用)。

Qt使用的不同版本的openssl lib,因此,如果不确定,应使用下面的静态函数在代码中对其进行测试:

QSslSocket::sslLibraryBuildVersionString();