简体   繁体   English

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

[英]Qt, WIndows and OpenSSL - Cannot Call Unresolved Function xyz

I've recently installed the ArcGIS Runtime SDK on my Windows 10 machine running Qt 5.9.1. 我最近在运行Qt 5.9.1的Windows 10计算机上安装了ArcGIS Runtime SDK。 When attempting to build a simple QWidget application using one of the ArcGIS templates, I get the following errors: 尝试使用其中一个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

This problem seems to be quite common-place however most of the Google results come up with answers for Linux systems. 这个问题似乎很普遍,但是大多数Google结果为Linux系统提供了答案。

I have done the following: 我已经完成以下工作:

  • Downloaded and installed OpenSSL (from GnuWin32 OpenSSL) 下载并安装了OpenSSL(来自GnuWin32 OpenSSL)
  • Copied across the libeay32.dll and libssl32.dll to the build folder libeay32.dlllibssl32.dll复制到构建文件夹
  • Added the include path into the Qt pro file 在Qt pro文件中添加了include路径
  • Verified that network is in the QT += config section of the pro file 验证network是否在pro文件的QT += config部分中

Yet none of the above has made any difference. 但是,以上所有内容都没有任何区别。 I'm running MSVC 2015 32-bit kit. 我正在运行MSVC 2015 32位套件。

you have to add static libraries to your project. 您必须将静态库添加到您的项目。

Find out libeay32.lib and libssl32.lib and add them to your project. 找出libeay32.liblibssl32.lib并将它们添加到您的项目中。

Refer 参考

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

I think you need such two dll files:libeay32.dll and ssleay32.dll.I use the same version qt as you do,so you can download them from here or directly get the zip from here (which works for me). 我认为你需要这样的两个DLL文件:的libeay32.dll和ssleay32.dll.I使用相同版本的QT你做,这样你就可以下载它们在这里或直接从获得的zip 这里 (这为我的作品)。

Different version openssl lib used by Qt,so you should test it in you code using static function below if you are not sure about it: Qt使用了不同版本的openssl lib,因此,如果不确定,请使用下面的静态函数在代码中对其进行测试:

QSslSocket::sslLibraryBuildVersionString();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM