简体   繁体   中英

How to build Qt5 with OpenSSL support

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

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)

How to get the Qt to compile with OpenSSL support linked? What am I doing wrong?

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

then

nmake

and Voilà.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM