Code snippets‎ > ‎C++‎ > ‎

Qt

Installation

To link with a static CRT:
Summary edit: qtbase\mkspecs\win32-msvc2013\qmake.conf and change "-MD" to "-MT".

Building a shared Qt library (release only, no debug-dll's needed).

From a visual studio shell:
cd qtbase
nmake confclean
cd ..

configure.bat -debug-and-release -
qtnamespace qt -opengl desktop -mp -no-ltcg -no-compile-examples -opensource -platform win32-msvc2013 -opengl desktop -prefix d:\libraries\qt\Qt5.2.1_32

nmake install


For 64 libraries, start a windows 64 bit command prompt and enter (yes, the platform is win32):
cd qtbase
nmake confclean
cd ..

configure.bat -debug-and-release -qtnamespace qt -opengl desktop -mp -no-ltcg -no-compile-examples -opensource -platform win32-msvc2013 -opengl desktop -qtlibinfix 64 -prefix d:\libraries\qt\Qt5.2.1_64

nmake install



Edit:

configure.bat -debug-and-release -qtnamespace qt -opengl desktop -make tools -D _ITERATOR_DEBUG_LEVEL=0 -mp -no-ltcg -no-compile-examples -opensource -platform win32-msvc2013 -opengl desktop -qtlibinfix 64 -prefix c:\source\libraries\qt\Qt5.4.1_64
nmake install

cd qttools
qmake qttools.pro
nmake

Edit for Visual studio 2017 (Qt 5.11.2):

From a visual studio developer command prompt (32 / 64 bits), start configure and then make the libraries (note the prefix directory)
set path=%path%;C:\Source\Qt_2017\python-3.7.1-embed-amd64;C:\Source\Qt_2017\strawberry-perl-5.28.0.1-64bit-portable\c\bin

configure -release -nomake examples -nomake tests -skip qtwebengine -opensource -platform win32-msvc -qtnamespace qt -confirm-license -mp -prefix ..\32bits\

nmake

nmake install



configure -release -nomake examples -nomake tests -skip qtwebengine -opensource -platform win32-msvc -qtnamespace qt -confirm-license -mp -prefix ..\64bits\ -qtlibinfix 64

nmake
nmake install

Slow initialization of Qt
When creating a QApplication is extremely slow on some computers, this might be caused by scanning the PC for qwindows.dll. This is caused when using a custom platformpluginpath (<executable> -platformpluginpath <dir>). To improve initialization, you should put qwindows.dll in the platforms directory and not specify a custom platformpluginpath.

Extensions

Libraries with additional widgets:
Subpages (1): Usefull Qt links
Comments