<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <!-- installation.qdoc --> <title>Installing Qt for Windows | QtDoc 5.1</title> <link rel="stylesheet" type="text/css" href="style/offline.css" /> </head> <body> <div class="header" id="qtdocheader"></div> <div class="content"> <div class="line"> <div class="content mainContent"> <link rel="prev" href="installation.html" /> <p class="naviNextPrevious headerNavi"> <a class="prevPage" href="installation.html">Installation</a> </p><p/> <div class="toc"> <h3><a name="toc">Contents</a></h3> <ul> <li class="level1"><a href="#step-1-install-the-license-file-commercial-editions-only">Step 1: Install the License File (commercial editions only)</a></li> <li class="level1"><a href="#step-2-unpack-the-archive">Step 2: Unpack the Archive</a></li> <li class="level1"><a href="#step-3-set-the-environment-variables">Step 3: Set the Environment variables</a></li> <li class="level1"><a href="#step-4-build-the-qt-library">Step 4: Build the Qt Library</a></li> <li class="level1"><a href="#qt-demos-and-examples">Qt Demos and Examples</a></li> </ul> </div> <h1 class="title">Installing Qt for Windows</h1> <span class="subtitle"></span> <!-- $$$install-win.html-description --> <div class="descr"> <a name="details"></a> <p>Qt for Windows has some requirements that are given in more detail in the <a href="requirements-win.html">Qt for Windows Requirements</a> document. A binary package is available and the <a href="qtinstaller.html">Qt Installation Program</a> page describes the installation in more detail.</p> <a name="step-1-install-the-license-file-commercial-editions-only"></a> <h2>Step 1: Install the License File (commercial editions only)</h2> <p>If you have the commercial edition of Qt, copy the license file from your account on the distribution server into your home directory (this may be known as the <tt>userprofile</tt> environment variable) and rename it to <tt>.qt-license</tt>. This renaming process must be done using a <i>command prompt</i> on Windows, <b>not</b> with Windows Explorer. For example on Windows 2000, <tt>%USERPROFILE%</tt> should be something like <tt>C:\Documents and Settings\username</tt></p> <p>For the open source version you do not need a license file.</p> <a name="step-2-unpack-the-archive"></a> <h2>Step 2: Unpack the Archive</h2> <p>Uncompress the files into the directory you want Qt installed; e.g. <tt>C:\Qt\5.1.1</tt>.</p> <p><b>Note: </b>The install path must not contain any spaces or Windows specific file system characters.</p><a name="step-3-set-the-environment-variables"></a> <h2>Step 3: Set the Environment variables</h2> <p>We recommend creating a desktop link that opens a command prompt with the environment set up similar to the <b>Command Prompt</b> menu entries provided by the Windows SDKs. This is done by creating an application link passing a <tt>.cmd</tt> file setting up the environment and the command line option <tt>/k</tt> (remain open) to <tt>cmd.exe</tt>.</p> <p>Assuming the file is called <tt>qt5vars.cmd</tt> and the Qt folder is called <tt>qt-5</tt> and located under <tt>C:\qt</tt>:</p> <pre class="cpp">REM Set up Windows SDK <span class="keyword">for</span> <span class="number">64bit</span> CALL <span class="string">"C:\Program Files (x86)\MSVC10\VC\vcvarsall.bat"</span> amd64 set PATH<span class="operator">=</span>c:\qt\qt<span class="operator">-</span><span class="number">5</span>\qtbase\bin;c:\qt\qt<span class="operator">-</span><span class="number">5</span>\qtrepotools\bin;c:\qt\qt<span class="operator">-</span><span class="number">5</span>\gnuwin32\bin;<span class="operator">%</span>PATH<span class="operator">%</span> set QMAKESPEC<span class="operator">=</span>win32<span class="operator">-</span>msvc2010</pre> <p>A desktop link can then be created by specifying the command <tt>%SystemRoot%\system32\cmd.exe /E:ON /V:ON /k c:\qt\qt5vars.cmd</tt> as application and <tt>c:\qt\qt-5</tt> as working directory.</p> <p><b>Note: </b>Setups for <a href="http://www.mingw.org/">MinGW</a> are similar; they differ only in that the <tt>bin</tt> folder of the installation should be added to the path instead of calling the Windows SDK setup script. For <a href="http://www.mingw.org/">MinGW</a>, please make sure that no <tt>sh.exe</tt> can be found in the path, as it affects <tt>mingw32-make</tt>.</p><p>Settings required by the additional libraries (see <a href="requirements-win.html">Qt for Windows Requirements</a>) should also go this file below the call to the Windows SDK setup script.</p> <a name="step-4-build-the-qt-library"></a> <h2>Step 4: Build the Qt Library</h2> <p>The default behavior of configure is to create an in-source build of Qt 5. If you want to install Qt 5 to a separate location, you need to specify the command line option <tt>-prefix <location></tt>. Alternatively, the command line option <tt>-developer-build</tt> creates an in-source build for developer usage.</p> <p>To configure the Qt library for a debug build for your machine, type the following command in the command prompt:</p> <pre class="cpp">configure <span class="operator">-</span>debug <span class="operator">-</span>nomake examples <span class="operator">-</span>opensource</pre> <p>Type <tt>configure -help</tt> to get a list of all available options.</p> <p>To build Qt using <a href="http://qt-project.org/wiki/jom">jom</a>, type:</p> <pre class="cpp">jom</pre> <p>If you do not have <a href="http://qt-project.org/wiki/jom">jom</a> installed, type:</p> <pre class="cpp">nmake</pre> <p>For <a href="http://www.mingw.org/">MinGW</a>, type:</p> <pre class="cpp">mingw32<span class="operator">-</span>make</pre> <p>If an installation prefix was given, type <tt>jom install</tt>, <tt>nmake install</tt> or <tt>mingw32-make install</tt>.</p> <p><b>Note: </b>If you later need to reconfigure and rebuild Qt from the same location, ensure that all traces of the previous configuration are removed by entering the build directory and typing <tt>nmake distclean</tt> before running <tt>configure</tt> again.</p><p><b>That's all. Qt is now installed.</b></p> <a name="qt-demos-and-examples"></a> <h2>Qt Demos and Examples</h2> <p>If you are new to Qt, we suggest that you take a look at the examples to see Qt in action (provided in the <tt>examples</tt> folder of each module).</p> <p>You might also want to try the following links:</p> <ul> <li>How to Learn Qt</li> <li><a href="qtexamplesandtutorials.html">Qt Examples and Tutorials</a></li> <li><a href="deployment.html">Deploying Qt Applications</a></li> </ul> <p>We hope you will enjoy using Qt. Good luck!</p> </div> <!-- @@@install-win.html --> <p class="naviNextPrevious footerNavi"> <a class="prevPage" href="installation.html">Installation</a> </p> </div> </div> </div> <div class="footer"> <p> <acronym title="Copyright">©</acronym> 2013 Digia Plc and/or its subsidiaries. Documentation contributions included herein are the copyrights of their respective owners.</p> <br /> <p> The documentation provided herein is licensed under the terms of the <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation License version 1.3</a> as published by the Free Software Foundation.</p> <p> Documentation sources may be obtained from <a href="http://www.qt-project.org"> www.qt-project.org</a>.</p> <br /> <p> Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide. All other trademarks are property of their respective owners. <a title="Privacy Policy" href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p> </div> </body> </html>