QT SSL QSslSocket: cannot call unresolved function SSLv23_client_method

今天在QT项目中,需要用到和https协议来访问服务器,然而在调用服务器时却发现程序运行时,QT控制台报错如下:

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

查了一下发现遇到此类问题的人还是蛮多的。解决方法很简单:

1. 在ssl官网下载安装包,运行安装。

2. 在安装目录找到libeay32.dll和ssleay32.dll,将其拷贝到exe的运行目录,或者xxx\Qt5.4.2\5.4\mingw491_32\bin(其中xxx为QT的安装目录).

参考:

Qt 5.4错误"qt.network.ssl: QSslSocket: cannot call"

Qt 之 使用 https:// 发送 HTTP请求



你可能感兴趣的:(C++/C)