使用 QSslSocket 时未解析的函数

问题描述:

我尝试运行一个用 Qt 编写并使用 QSslSocket 的简单程序.

I tried to run a simple program that is written with Qt and uses QSslSocket.

我在安装了OpenSSL的Ubuntu 12.04机器上运行这个程序.

I'm running this program on a Ubuntu 12.04 machine with OpenSSL installed.

但我收到以下错误:

QSslSocket: cannot call unresolved function SSLv3_client_method
QSslSocket: cannot call unresolved function SSL_CTX_new
QSslSocket: cannot call unresolved function SSL_library_init
QSslSocket: cannot call unresolved function ERR_get_error

如何修复这些错误?

安装最新的 openSSL 版本.yum install openssl ,yum install libssl-dev..

Install the latest openSSL version. yum install openssl ,yum install libssl-dev..

并在您的 .pro 文件中添加 QT += 网络

And add QT += network in your .pro file

来源:http://codeblog.vurdalakov.net/2009/11/solution-qsslsocket-cannot-call.html