User Tools

Site Tools



Building Qt on Windows

Windows build environment (MinGW32)

  • Configure options (4.8):
Package Version Filename SHA1 Digest Notes
Qt 5.0.2 source 61b4ea0c483efb1b88b6209f47ce7ef1039cad95
MinGW-builds MinGW32 32bit; posix-threads; sjlj x32-4.7.2-release-posix-sjlj-rev11.7z c94b3852841ef1b96cd085dd948d615d5742ab1a
Strawberry Perl 64bit portable 4172048e69bdf21668c069fe1260e62d180ab7d6 These directories may be omitted/deleted:
  • c
Python 2.7.5 64bit Installer python-2.7.5.amd64.msi e7139a30ee91b2df82665d0e9ead6f36c670e59d Python 3.3.2 failed some self tests when building QtWebkit, so use Python 2.7.x
Minimal: Install without optional packages (except Tools?).
Portable: Copy installed Python27.dll (and system's msvcr90.dll?) into base directory.
Ruby 2.0.0-p195 (x64) 7-Zip archive ruby-2.0.0-p195-x64-mingw32.7z 7d6100bf2008d1229a1252521602b0fda94c4ceb
MSYS 1.0.11 Installer MSYS-1.0.11.exe 1edad9d1b67b48c92781b3ccddbd1cc9ce64d78a Using old monolithic MSYS (up till 1.0.11)
TODO: MinGW-builds external-binary-packages
jom 1.0.13 e4059a58be58d04e70a1935b6886e28b69be7b82
QtBinPatcher 738a26c071f491a12ffdcfd73ef46e7112bf3d6f Git repo snapshot
DirectX SDK June 2010 DXSDK_Jun10.exe 8fe98c00fde0f524760bb9021f438bd7d9304a69 These directories may be omitted/deleted:
  • Developer Runtime
  • Redist (copy correct redist package first!)
  • Documentation
  • Samples
  • system
Portable: Install, backup installation dir, unset environment var DXSDK_DIR, uninstall.

Building dependencies


Website Download

IMPORTANT: Use tar for extracting in order to preserve symlinks.

IMPORTANT: Explicitly set --openssldir. Else the build paths will be used. On some systems this seems not to work. Possible reason: OpenSSL exits with "Auto configuration failed" because the SSL-config file does not only not exist (ENOENT), but can't be accessed (e.g. "Drive not ready"). Using C:\OpenSSL might be a suitable workaround, as QSslSocket always initializes OpenSSL in auto-configuration mode.

$ ./Configure --prefix=$PWD/dist --openssldir='C:\OpenSSL' threads shared mingw
$ make depend && make && make install


Website Download
$ export PATH=$PATH_TO_MINGW/bin:$PATH
$ cd source
$ ./runConfigureICU MinGW --prefix=$PWD/../dist
$ make && make install

Helper script

@echo off
REM see
set _QT_SRC=%CD%\qt-everywhere-opensource-src-5.0.2
set PATH=%CD%\icu\dist\bin;%CD%\openssl-1.0.1e\dist\bin;%_QT_SRC%\gnuwin32\bin;%CD%\mingw32\bin;%CD%\tools;%CD%\python;%CD%\ruby\bin;%CD%\perl\bin;%SYSTEMROOT%\system32;%SYSTEMROOT%
set INCLUDE=%CD%\icu\dist\include;%CD%\openssl-1.0.1e\dist\include
set LIB=%CD%\icu\dist\lib;%CD%\openssl-1.0.1e\dist\lib
REM set QMAKESPEC=win32-g++
REM [Angle source]
REM Qt has bundled Angle version; use ANGLE_DIR if custom Angel source is required
REM set ANGLE_DIR=%CD%\angleproject
REM [DirectX SDK]
REM Caution: Trailing backslash is required!
set DXSDK_DIR=%CD%\DirectX_SDK_June2010\
echo Qt build script / environment
echo ===============================================================================
echo PATH=%PATH%
echo LIB=%LIB%
echo ===============================================================================
REM Install prefix
if not exist %_QT_SRC%\dist mkdir %_QT_SRC%\dist
REM Build directory
if not exist %_QT_SRC%\build (
	echo Press any key to run 'configure' & pause & echo.
	mkdir %_QT_SRC%\build
	cd %_QT_SRC%\build
	cmd /c ^
	  %_QT_SRC%\configure -prefix %_QT_SRC%\dist ^
	  -platform win32-g++ -opensource -confirm-license ^
	  -debug-and-release -debug -release -c++11 -shared ^
	  -nomake tests -nomake examples -nomake demos ^
	  -openssl-linked OPENSSL_LIBS="-llibcrypto -llibssl" ^
	  -icu -iconv ^
	  -angle -opengl es2 ^
	  -no-audio-backend -no-native-gestures
) else (
	cd %_QT_SRC%\build
echo. & echo Now run something like 'mingw32-make -j4' or 'jom /W /S' & echo.
echo. & echo Press any key to exit. & pause


qt.txt · Last modified: 2013-07-02 12:04 CEST by dominik