Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>UPDATE: Use <code>windeployqt.exe</code>! It works really well.</p> <p><a href="http://doc.qt.io/qt-5/windows-deployment.html#the-windows-deployment-tool" rel="nofollow noreferrer">http://doc.qt.io/qt-5/windows-deployment.html#the-windows-deployment-tool</a></p> <blockquote> <p>The simplest way to use windeployqt is to add the bin directory of your Qt installation (e.g. ) to the PATH variable and then run:</p> <pre><code>windeployqt &lt;path-to-app-binary&gt; </code></pre> </blockquote> <p>UPDATE: Upon Further testing, <code>windeployqt</code> did not copy over all the MingW dlls for me. (Tested with Qt 5.4 on Windows 10 with MingW 4.9.1). So you need to manually get the last 3 dlls before deploying:</p> <pre><code>libgcc_s_dw2-1.dll libstdc++-6.dll libwinpthread-1.dll </code></pre> <p>From</p> <pre><code>C:\Qt\5.4\mingw491_32\bin </code></pre> <hr> <p>I think you may have a few extras in your list... I would double check the docs in the links below...</p> <p>Here is the definitive documentation on it:</p> <p><a href="http://doc.qt.io/qt-5/windows-deployment.html" rel="nofollow noreferrer">http://doc.qt.io/qt-5/windows-deployment.html</a></p> <p><a href="http://doc.qt.io/qt-5/windows-deployment.html#application-dependencies" rel="nofollow noreferrer">http://doc.qt.io/qt-5/windows-deployment.html#application-dependencies</a></p> <h2>Size of Qt DLLs</h2> <p>The amazing Qt Libraries can do a lot, but they are kind of big. Some of the older versions of Qt might be a little smaller.</p> <p>For Qt 4.8 msvc <code>QtCore4.dll</code> is 2.5 MB, and <code>QtGui4.dll</code> is 8.4 MB.</p> <h2>How Windows Resolves Shared Libraries/Dynamic Link Libraries (DLL)</h2> <p>Here is how Windows tracks down a library at runtime:</p> <p><a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms682586(v=vs.85).aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/windows/desktop/ms682586(v=vs.85).aspx</a></p> <h2>Single Small EXE</h2> <p>If you statically link, then your EXE should grab the libraries it needs and gets built into a stand alone exe. It still may be dependent on msvc redistributables. See the next section for more info on it. But it now compiles down the <code>.lib</code>s that you reference into your EXE and your exe no longer is pointing at other dynamically linked libraries. It does take more time to get your statically linked exe environment setup.</p> <p>Your exe will certainly get bigger as it now includes the binary information for the libraries that you referenced before.</p> <p><a href="https://www.google.com/search?q=qt+static+linking" rel="nofollow noreferrer">https://www.google.com/search?q=qt+static+linking</a></p> <p>EDIT: Statically building the exe, <strike>means that you aren't using the LGPL version.</strike> means that you have to have your object files easy to access to end users if you are using LGPL.</p> <p>I think @peppe described it well (see comment below):</p> <blockquote> <p>Technically, you are allowed to statically link when using Qt under LGPL, even if your application is not using LGPL. The only tricky requirement is keeping the ability for a third party to relink your application against a different Qt version. But you can comply with that easily, f.i. by providing a huge object file (.o) of your application, that only needs to be linked against any Qt version.</p> </blockquote> <p><a href="http://blog.qt.io/blog/2009/11/30/qt-making-the-right-licensing-decision/" rel="nofollow noreferrer">http://blog.qt.io/blog/2009/11/30/qt-making-the-right-licensing-decision/</a></p> <p>Look at the chart near the bottom. If you are doing the commercial version, then you can statically link, without worrying about the object files.</p> <h2>MSVC Redistributables</h2> <p>Redistributable dependencies have to do with the run-time library linker options.</p> <p><a href="http://msdn.microsoft.com/en-us/library/aa278396(v=vs.60).aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/aa278396(v=vs.60).aspx</a></p> <p><code>/MD, /ML, /MT, /LD</code> (Use Run-Time Library)</p> <blockquote> <p>To find these options in the development environment, click Settings on the Project menu. Then click the C/C++ tab, and click Code Generation in the Category box. See the Use Run-Time Library drop-down box.</p> </blockquote> <p>These two links below talk about some older versions of visual studio, but the reasoning should still stand.</p> <p><a href="http://www.davidlenihan.com/2008/01/choosing_the_correct_cc_runtim.html" rel="nofollow noreferrer">http://www.davidlenihan.com/2008/01/choosing_the_correct_cc_runtim.html</a></p> <p><a href="https://stackoverflow.com/questions/37398/how-do-i-make-a-fully-statically-linked-exe-with-visual-studio-express-2005">How do I make a fully statically linked .exe with Visual Studio Express 2005?</a></p> <p>Hope that helps.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload