gpt4 book ai didi

c++ - QSslSocket 错误

转载 作者:太空宇宙 更新时间:2023-11-04 12:07:10 25 4
gpt4 key购买 nike

在 Windows 7 Ultimate x64 上的 Qt 4.8 中,当我尝试使用 QNetworkAccessManager 通过网络进行 post() 操作时:

_net_acc_mgr.post(QNetworkRequest(QUrl(...)),
QByteArray(...));

我遇到以下运行时错误:

QSslSocket: cannot resolve OPENSSL_add_all_algorithms_noconf
QSslSocket: cannot resolve OPENSSL_add_all_algorithms_conf
QSslSocket: cannot call unresolved function OPENSSL_add_all_algorithms_noconf
content-type missing in HTTP POST, defaulting to application/octet-stream

我清楚地记得几年前使用的相同代码。但是我忘了我试过哪个版本的 Qt。

在 Qt 4.8 中使用 QNetworkAccessManager 是否还有其他要求?

最佳答案

  • QT 运行在 32 位

  • Windows 64bit 文件夹 system32 中没有 DLLOpenSSL 需要,仅在 sysWOW64 文件夹中。

  • 要解决这个问题,您需要安装二进制版本的OpenSSL 32

为 Windows 下载编译(更新链接):

http://slproweb.com/download/Win32OpenSSL_Light-1_0_1g.exe

Note: During install select the option "The OpenSSL binaries (/bin) directory" (Probably C:\OpenSSL-Win32)

安装后复制 DLL(来自 C:\OpenSSL-32%HOMEDRIVE%\OpenSSL-32)用于发布/调试项目文件夹:

  • libeay32.dll
  • libssl32.dll
  • ssleay32.dll

另一种选择是使用 Mingw 64bit,但不知道这是否适用于 QT(这种情况下,如果您可以编译应用程序,仅在 64 位系统上运行)。

关于c++ - QSslSocket 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11546590/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com