How to compile QT 5.7 with VS2015

Below I provided a simple step by step instruction on how to compile QT 5.7 with VS2015 assuming you already have VS2015 and Git client installed on your Windows machine.

Install Perl, Python and Ruby.

To get QT 5.7 sources open Git Bash and run the following command (the repository has some submodules, so “recursive” option is required):

git clone --recursive --branch 5.7

Create a bat file called configureqt.bat with the following content:

set PATH=%PATH%;"C:\Program Files (x86)\Portable\ruby-2.3.0-i386-mingw32\bin";C:\Perl\bin;C:\Python27
cd D:\Repos\qt5\
set _ROOT=D:\Repos\qt5
set PATH=%_ROOT%\qtbase\bin;%_ROOT%\gnuwin32\bin;%PATH%
set QMAKESPEC=win32-msvc2015
set _ROOT=
configure -debug -nomake examples -opensource

Another alternative configuration (last line in the bat file) is:

configure -debug -confirm-license -opensource

it compiles QT with all the examples and does not ask to accept the license.

Open VS2015 Command Prompt x86 and run configureqt.bat. If everything went right run nmake and wait a few hours.

To create your first QT project in VS2015 go to Tools->Extensions and Updates and install Qt5Package:


Restart VS2015, Go to QT5->Qt Options and specify the path to QT binaries:

the path to QT binaries

Go to File->New->Project and select Templates->Visual C++->Qt5 Projects->Qt Application:

QT Project

Click OK, and select modules you want to include in your project:

QT Project

and then lick Finish.

No Responses to How to compile QT 5.7 with VS2015

  1. Jack on September 23, 2016 at 7:29 PM:

    QT doesnt work with visual studio when compiled using MinGW

Leave a Reply

Your email address will not be published. Required fields are marked *