본문 바로가기

Development

Build Qt5 with Microsoft Visual Studio 2013

::Requirements

1. Qt source codes
2. Visual Studio 2013 (express, professional or ultimate)
3. Python
4. WinDbg (optional)


::Steps

1. Getting the Qt source codes
 - Download the source codes from http://qt-project.org/downloads
 - Extract the zip file into target folder
  *Notes: The absolute paths are hard-coded into binary files, therefore, the target folder cannot be changed

2. Install python
 - Bypass this step if Python is already installed
 - Download the lastest python from https://www.python.org/downloads/

2a. Edit qmake.conf (optional, for static build only)
 - Bypass this step for dynamic build
  *Edit './qtbase/mkspecs/win32-msvc2013/qmake.conf'
 - QMAKE_CFLAGS_RELEASE = -O2 -MT
 - QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -O2 -MT -Zi
 - QMAKE_CFLAGS_DEBUG = -Zi -MTd

3. Configuration
 - Open the VS2013 Tools Command Prompt (x64 for 64bit Qt build, x86 for 32bit build)
 - Configure with options
Ex) configure -c++11 -mp -debug-and-release -static -angle -nomake tests -nomake examples -platform win32-msvc2013
  (-c++11 for c++11 support, -angle for ANGLE support, -mp for multi processor, -static for static build,
  -platform win32-msvc2013 for Visual Studio 2013)
  For the full list of options, enter the command configure -h

3a. For SSL support (optional)
 - Download the openssl source codes from https://www.openssl.org/source/ and compile them
 - Configure Qt with '-openssl' option ('-openssl-linked' for static build)
 - '-I [openssl header dir] -L [openssl lib dir] -l Gdi32' may also be needed
Ex) configure -c++11 -mp -debug-and-release -static -angle -nomake tests -nomake examples -platform win32-msvc2013 -openssl-linked -I ../openssl/include -L ../openssl/lib64 -l Gdi32


4. Make
 - Run nmake

5. Install WinDbg (optional)
For debugging support, download the WinDbg from Dev Center