Qt5.x Build Environment on Windows - magic-lantern-studio/mle-documentation GitHub Wiki
To get Qt 5.15.x working on your Windows 10 platform and, in addition, set up all required software to properly work together, use these QuickStart instructions.
Note
Unfortunately the current Qt installer no longer supports Qt5, so we have to build it from scratch.
Download the qt-everywhere-opensource-src-5.15.14.zip package from Qt Downloads for version 5.15.14.
Also download and install the QtCreator IDE tool which can be obtained from this URL.
Instructions for building the Qt 5.15 open source can be found on Windows Building wiki.
The build dependencies are discussed on Windows Requirements wiki.
In your working directory, unzip the qt-everywhere-opensource-src-5.15.14.zip package. Note that this is an extremely large package, so you will need a considerable amount of disk space to build this source. The source will be in unzipped into the qt-everywhere-src-5.15.14 directory.
Note
Use C:\Qt as the working directory. Then move or rename the qt-everywhere-src-5.15.14 directory to Qt-5.15.14. Just make sure the working directory doesn't contain any spaces. So the downloaded, unzipped source should now be located in C:\Qt\Qt-5.15.14.
From the README file:
Open a command prompt.
Ensure that the following tools can be found in the path:
* Supported compiler (Visual Studio 2012 or later,
MinGW-builds gcc 4.9 or later)
* Perl version 5.12 or later [http://www.activestate.com/activeperl/]
* Python version 2.7 or later [http://www.activestate.com/activepython/]
* Ruby version 1.9.3 or later [http://rubyinstaller.org/]
cd <path>\<source_package>
configure -prefix %CD%\qtbase <license> -nomake tests
nmake // jom // mingw32-make
To accelerate the bootstrap of qmake with MSVC, it may be useful to pass
"-make-tool jom" on the configure command line. If you do not use jom,
adding "/MP" to the CL environment variable is a good idea.
Use the provided qt5vars.cmd Windows command script to set up the variables for building Qt using Microsoft Visual Studio 2017 Community edition. This script assumes that the source has been staged in C:\Qt\Qt-5.15.14 directory and is targeting the x64 architecture.
Establish the build configuration:
cd C:\Qt\Qt-5.15.14
configure -nomake examples -nomake tests -opensource -prefix %CD%\qtbase
Now build the source:
nmake
Note
You may run into build issues with the qtconnectivity module. You can skip this module by re-configuring the build with "-skip qtconnectivity". For example: configure -nomake examples -nomake tests -skip qtconnectivity -opensource -prefix %CD%\qtbase
You can use this approach to skip building any of the Qt modules.
The artifacts for the build will be found in C:\Qt\Qt-5.15.14\qtbase lib, bin and include directories.
All required software components should now be installed. It's time to collect everything into the build Kit.
- Run QtCreator (typically, it is in C:\Qt\qtcreator-14.0.0).
- Open Preferences.
- Select the “CMake” tab. Manually add a new entry in "Tools".
- Select the “Kits” tab.
- Open “Qt Versions”. Click the button “Link with Qt…”. Your Qt installation path should be C:\Qt.
- Hit “Apply” before jumping to the next page.
- Open the “Kits” tab.
- Manually add new Qt5x kit. You may name it initially, like Qt 5.15.14 (C:\Qt\Qt-5.15.14\qtbase\bin\qmake.exe).
Online documentation for Qt 5.15 on Windows can be found at Qt Windows.