如何建立与QT5支持的OpenSSL [英] How to build Qt5 with OpenSSL support
问题描述
什么是支持SSL的建设QT5正确的配置?使用以下命令行我已经编译当前静态的OpenSSL与VC2008:
What is the correct configuration for building Qt5 with SSL support? I have currently compiled OpenSSL statically with VC2008 using the following command lines:
perl Configure VC-WIN32 --prefix=C:\Build-OpenSSL-VC-32
ms\do_ms
nmake -f ms\nt.mak
nmake -f ms\nt.mak install
配置的Qt 5.3.1有:
Configured Qt 5.3.1 with:
configure -developer-build -opensource -nomake examples -nomake tests -mp -confirm-license -opengl desktop -no-icu -skip qtserialport -skip qtwebkit-examples -platform win32-msvc2008 -openssl-linked OPENSSL_LIBS="-lssleay32 -llibeay32" -I C:\Build-OpenSSL-VC-32\include -L C:\Build-OpenSSL-VC-32\lib
我得到多个联动错误,如
I get multiple linkage errors like
moc_qnetworkreply.obj : error LNK2001: unresolved external symbol "public: bool __thiscall QSslCertificate::operator==(class QSslCertificate const &)const " (??8QSslCertificate@@QBE_NABV0@@Z)
如何让Qt来编译OpenSSL的支持联系在一起?我在做什么错了?
How to get the Qt to compile with OpenSSL support linked? What am I doing wrong?
推荐答案
确定最后我发现它重新配置之前清理的配置是非常重要的。在Qt NMAKE confclean
的previous版本的伎俩,但似乎它不工作了。据 QTBUG-34304 现在它是有用的做 git的子模块的foreach --recursive混帐干净-dfx
而不是 NMAKE confclean
。后大约需要GDI32.LIB和user32.ilb那几个更多的调整,以获得下列configure行工作:
OK finally I found that it is quite important to clean the configuration before reconfiguring. In previous versions of Qt nmake confclean
did the trick but it seems it does not work anymore. According to QTBUG-34304 for now it is usefull to do git submodule foreach --recursive "git clean -dfx"
instead of nmake confclean
. After that a few more tweaks about gdi32.lib and user32.ilb were required to get the following configure line work:
configure -developer-build -opensource -nomake examples -nomake tests -mp -confirm-license -opengl desktop -no-icu -skip qtserialport -skip qtwebkit-examples -platform win32-msvc2008 -openssl-linked OPENSSL_LIBS="-lssleay32 -llibeay32" -I C:\Build-OpenSSL-VC-32\include -L C:\Build-OpenSSL-VC-32\lib -L "C:\Program Files\Microsoft SDKs\Windows\v6.0A\Lib" -l Gdi32 -l User32
然后
nmake
和瞧。
这篇关于如何建立与QT5支持的OpenSSL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!