请问QT中如何使用SSL

程序x人生 2010-07-07 12:47:12
我已经下载openssl-1.0.0a并编译,把libeay32.dll、ssleay32.dll和libeay32.lib、ssleay32.lib分别拷贝到QT的相关bin目录和lib目录,但在程序中使用的时候,链接没过:
1>SSLClient.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall QSslSocket::~QSslSocket(void)" (__imp_??1QSslSocket@@UAE@XZ) referenced in function __unwindfunclet$??0SSLClient@PadSystem@@QAE@PAVQObject@@@Z$0
1>SSLClient.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall QSslSocket::QSslSocket(class QObject *)" (__imp_??0QSslSocket@@QAE@PAVQObject@@@Z) referenced in function "public: __thiscall PadSystem::SSLClient::SSLClient(class QObject *)" (??0SSLClient@PadSystem@@QAE@PAVQObject@@@Z)
1>SSLClient.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall QSslSocket::ignoreSslErrors(void)" (__imp_?ignoreSslErrors@QSslSocket@@QAEXXZ) referenced in function "public: void __thiscall PadSystem::SSLClient::errorOccured(class QList<class QSslError> const &)" (?errorOccured@SSLClient@PadSystem@@QAEXABV?$QList@VQSslError@@@@@Z)
1>SSLClient.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall QSslCertificate::~QSslCertificate(void)" (__imp_??1QSslCertificate@@QAE@XZ) referenced in function "public: void __thiscall PadSystem::SSLClient::connectionEstablished(void)" (?connectionEstablished@SSLClient@PadSystem@@QAEXXZ)
1>SSLClient.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class QSslCertificate __thiscall QSslSocket::peerCertificate(void)const " (__imp_?peerCertificate@QSslSocket@@QBE?AVQSslCertificate@@XZ) referenced in function "public: void __thiscall PadSystem::SSLClient::connectionEstablished(void)" (?connectionEstablished@SSLClient@PadSystem@@QAEXXZ)
1>SSLClient.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall QSslSocket::connectToHostEncrypted(class QString const &,unsigned short,class QFlags<enum QIODevice::OpenModeFlag>)" (__imp_?connectToHostEncrypted@QSslSocket@@QAEXABVQString@@GV?$QFlags@W4OpenModeFlag@QIODevice@@@@@Z) referenced in function "public: void __thiscall PadSystem::SSLClient::start(class QString,unsigned short)" (?start@SSLClient@PadSystem@@QAEXVQString@@G@Z)
1>E:\Pad4x\branches\4.8.0_refact\build\Win32\Debug\SSLClient.exe : fatal error LNK1120: 6 unresolved externals

帮忙看一下问题在哪?谢谢!
...全文
455 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
swift19221 2010-12-27
  • 打赏
  • 举报
回复
不懂,混分
tingsking18 2010-07-14
  • 打赏
  • 举报
回复
额,好像是没有连接上openssl的库
luo357101919 2010-07-13
  • 打赏
  • 举报
回复
缺少库文件QtNetWork.lib
lefttime 2010-07-07
  • 打赏
  • 举报
回复
既然已经知道是链接问题了, 那应该很容易定位~~``
1. 是否引入了需要的库文件?
2. 调用的函数是否是引入的库文件对应公布的接口?
lefttime 2010-07-07
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 faithcj 的回复:]

我用的是VS2008,在工程属性-Additional Dependencies里已经加入libeay32.lib和
ssleay32.lib了
可还是有链接问题
[/Quote]

Additional Library Directories是否设置正确?
程序x人生 2010-07-07
  • 打赏
  • 举报
回复
我用的是VS2008,在工程属性-Additional Dependencies里已经加入libeay32.lib和
ssleay32.lib了
可还是有链接问题

16,203

社区成员

发帖
与我相关
我的任务
社区描述
Qt 是一个跨平台应用程序框架。通过使用 Qt,您可以一次性开发应用程序和用户界面,然后将其部署到多个桌面和嵌入式操作系统,而无需重复编写源代码。
社区管理员
  • Qt
  • 亭台六七座
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧