<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[How to statically link Qt on Windows w Visual Studio 2017]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">I've just purchased the QT commercial license and my (maybe naive) understanding was that when Qt installed under this license, static linking would be as simple as adding "CONFIG += static" into the project .PRO file, however this doesn't work. (The build defaults to dynamic linking, which does work but requires running windeployqt.exe.) "QMAKE_LFLAGS = -MT" doesn't help with static linking either.</p>
<p dir="auto">Can anyone - preferably commercial license holders - point me in the right direction? I'm using Visual Studio 2017 with the QT plugin, and Qt versions 5.9.5 and newer.</p>
<p dir="auto">Many pages talk about first rebuilding Qt with static options. E.g.<br />
<a href="https://wiki.qt.io/Build_Standalone_Qt_Application_for_Windows" target="_blank" rel="noopener noreferrer nofollow ugc">https://wiki.qt.io/Build_Standalone_Qt_Application_for_Windows</a></p>
<p dir="auto">They refer to running "configure" however my PC (which includes MSVC2017 and QT) only has some "configure.prf" files in some QT mkspecs\features directories. There aren't any configure.exe or configure.bat files.</p>
<p dir="auto"><a href="http://doc.qt.io/qt-5/windows-deployment.html#linking-the-application-to-the-static-version-of-qt" target="_blank" rel="noopener noreferrer nofollow ugc">http://doc.qt.io/qt-5/windows-deployment.html#linking-the-application-to-the-static-version-of-qt</a><br />
doesn't help either.</p>
<p dir="auto">Many thanks,<br />
M</p>
]]></description><link>https://forum.qt.io/topic/91176/how-to-statically-link-qt-on-windows-w-visual-studio-2017</link><generator>RSS for Node</generator><lastBuildDate>Sat, 05 Sep 2026 04:56:23 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/91176.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 30 May 2018 01:46:24 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to statically link Qt on Windows w Visual Studio 2017 on Wed, 30 May 2018 03:40:47 GMT]]></title><description><![CDATA[<p dir="auto">Ok, after running the Qt maintenance tool again and downloading the Src directory for Qt 5.9.5, I found the "configure.bat" file in c:\Qt\5.9.5\Src.</p>
<p dir="auto">I then started the Visual Studio 2017 Command Prompt, changed to the c:\Qt\5.9.5\Src directory and ran<br />
configure -static -release -platform win32-msvc<br />
The bat file prompted me for a few extra things, such as licensing.</p>
<p dir="auto">When the script finished, I ran<br />
nmake<br />
only to have the build fail at ioutils.cpp with a path problem.</p>
<p dir="auto">Turns out c:\Qt\5.9.5\Src\bin\qt.conf had unix paths, instead of Windows paths, so I changed the three Prefix lines to C:\Qt\5.9.5 and restarted nmake.</p>
<p dir="auto">So far the build is working.</p>
<p dir="auto">Best,<br />
M</p>
]]></description><link>https://forum.qt.io/post/460960</link><guid isPermaLink="true">https://forum.qt.io/post/460960</guid><dc:creator><![CDATA[mjsmithers]]></dc:creator><pubDate>Wed, 30 May 2018 03:40:47 GMT</pubDate></item></channel></rss>