title: Deploying Qt 5 App on Windows
body: <p>I've written a couple of applications in QML (part of Qt 5). In a question that I've made before (<a href="https://softwareengineering.stackexchange.com/questions/213698/deploying-qt-based-app-on-mac-os-x">https://softwareengineering.stackexchange.com/questions/213698/deploying-qt-based-app-on-mac-os-x</a>), I found the solution for deploying my app on OS X (using the macdeployqt tool). </p>
  
  <p>Deploying Qt4 apps on Windows was easy:</p>
  
  <ol>
  <li>You compiled it in release mode.</li>
  <li>You copied the necessary libraries (DLLs).</li>
  <li>You tested and it worked.</li>
  </ol>
  
  <p>Unfortunately, this approach did not work in Qt5 (I even included the platforms folder with the qwindows.dll file and it did not work). After some days of trying, I gave up and compiled a static version of Qt5. </p>
  
  <p>Again, it did not work. The app works on a PC with Qt installed, but it crashes on "clean" PCs. As a side note, Windows 8/8.1 systems don't give a warning or a message notifying me about the app's crash. But in Windows 7 a message notifies me that the application crashed.</p>
  
  <p>I've tried running Dependency Walker (depends.exe) and all libraries in the static build of my application seemed fine.</p>
  
  <p>In Windows 8, I don't get any error. But after profiling the app in depends.exe, I get an access violation originating from QtGui.dll. The exact error is</p>
  
  <blockquote>
    <p>Second chance exception 0xC0000005 (Access Violation) occurred in "QT5GUI.DLL" at address 0x61C2C000.</p>
  </blockquote>
  
  <p>Is there something that I am missing (say an extra DLL or config file)?</p>
  
  <p>Application information:</p>
  
  <ul>
  <li>Written and compiled with Qt 5.2.1</li>
  <li>Uses Quick/QML.</li>
  <li>Uses the network module.</li>
  <li>Uses the webkit module.</li>
  <li>Uses the bluetooth module.</li>
  <li>The QML files are written in Quick 2.2</li>
  </ul>