I successfully compiled OpenSSL 1.0.1 under win32 with mingw. Now I’m trying to compile static Qt 4.8.1 with following config:
configure -release -static -qt-zlib -nomake examples -nomake demos -no-qt3support -no-scripttools -no-opengl -no-webkit -no-phonon -no-style-motif -no-style-cde -no-style-cleanlooks -no-style-plastique -no-sql-sqlite -openssl-linked OPENSSL_LIBS="-lssl -lcrypto -lgdi32 -luser32" -I H:\Workplace\OpenSSL\include -L H:\Workplace\OpenSSL
I got these errors:
H:\Workplace\OpenSSL/libssl.a(ssl_lib.o):ssl_lib.c:(.text+0x17be): undefined ref (several times)
erence to '_time32'
H:\Workplace\OpenSSL/libcrypto.a(o_time.o):o_time.c:(.text+0x362): undefined ref
erence to '_gmtime32'
H:\Workplace\OpenSSL/libcrypto.a(mem_dbg.o):mem_dbg.c:(.text+0x4c7): undefined r
eference to '_localtime32'
SOLVED (see below)
Finally I solved all problems, here is full solution to compile static Qt with static OpenSSL using TDM-GCC.
Download sources of latest OpenSSL and unpack them.
I used TDM-GCC to compile, so download and install it.
Install MSYS.
Create file
../MsysInstallDir/etc/fstabwith the following content:MyPathToMinGW /mingw(REQUIRED if you use tdm-gcc)MyPathToPerl /perl(perl is also required to be installed)./configmakeUPDATE: Recently I built 4.8.2 on another windows7 computer and got compiling error (while building my app): «cannot find -lQtCore4», «cannot find -lQtGui4». Here is the solution that helped me – edit file “qt-sources-dir/mkspecs/win32-g++/qmake.conf”. Set
QMAKE_LFLAGS = -static -static-libgccconfigure -release -static -qt-zlib -nomake examples -nomake demos -no-qt3support -no-scripttools -no-opengl -no-webkit -no-phonon -no-style-motif -no-style-cde -no-sql-sqlite -openssl OPENSSL_LIBS="-lssl -lcrypto -lgdi32 -luser32" -I MyOpenSSLdir\include -L MyOpenSSLdirrun
cmd. runmingwvars.batin mingw folder. runconf.batin qt sources folder (or add sources folder to the PATH and run it from another directory, to separate install from sources). It will take a few hours to compile Qt.add to project’s .pro file:
INCLUDEPATH += OpenSSLdir/include/I think it may help somebody.