Qt5 app won't start

I have created an application using Qt 5 (compiled with Visual Studio '12). It works on my machine.

However, it doesn't work when I try to run it on another computer. Output I compiled via cmd gave an empty file.

The directory structure looks like this:

  • myapp.exe
  • icudt52.dll
  • icuin52.dll
  • icuuc52.dll
  • libEGL.dll
  • libGLESv2.dll
  • msvcp120.dll
  • msvcr120.dll
  • Qt5Core.dll
  • Qt5Gui.dll
  • platforms /qminimal.dll
  • platforms /qwindows.dll

The most important message I found was Application deployed with QT5 libraries did not run on Windows 7 - however the solution (including qwindows.dll and qminimal.dll) did not work.

Any ideas?

+3


source to share


1 answer


Windows will report several startup errors when you double click on your exe outside of Qt Creator. It looks like you've already enabled most or all of them.

Your development machine will generally have no problem getting and running their qt plugins because of LibraryPaths

looking for your exe. http://qt-project.org/doc/qt-5/qcoreapplication.html#libraryPaths

Dependency Walker will do the job and show you what you need to know, but the result is quite complex and can be difficult to decipher.

The easiest way I've found to figure out which Qt DLL plugins I'm using at runtime on Windows is to do the following:

  • Quit Qt Creator.

  • Open the installation folder for the compiler you are using with Qt in explorer. For example:

    C:/Qt/5.3/msvc2010_opengl/
    
          

  • Make a copy of the folder plugins

    in place (the Copy of plugins

    folder is in the same path as plugins

    , so in this case its parent msvc2010_opengl

    ).

enter image description here

  1. In another explorer window, open your exe (Qt program) on your development machine. Do some minimal testing of your program to make sure that basic functionality works. (Many runtime plugins are not loaded until the QObjects that use them have been created.)

  2. Delete the folder plugins

    in the Qt path.

  3. Windows will close all DLL files that the exe is using and prevent you from deleting multiple DLL files. Click the skip button for all non-deletion folders and files.



enter image description here

  1. Now go to each of the folders that you previously could not delete and try to remove all the individual DLLs in each folder. Click the skip button for all non-removable dlls.

  2. Now that you're done, you remain a skeleton in the plugins folder, only displaying the DLLs your application uses.

  3. It will likely contain folders : accessibility

    , platforms

    and imageformats

    more depending on what you included in your file .pro

    .

  4. Close your exe.

  5. Copy the contents of your plugins split folder to sit next to your exe.

  6. Restore the plugins folder backup (remove the shared plugins folder from your Qt path and restore Copy of plugins

    ).

  7. You should be good to go now. Testing on a machine without development.

A note about VS C ++ Runtimes

Also on some machines, when deploying Qt with MSVC, the msvcrXXX.dll file does not match what the rest of the system uses. Instead of deploying msvcrXXX.dll, instead in our installers at our office, we include the Microsoft C ++ Distribution Installer and run it in the install script. And on a few machines, they messed up Redistributables, and we had to power up the Redistributables to fix the "Referral from server" error we sometimes got.

You can find the latest installer for common MSVC redistributables here Latest supported Visual C ++ files .

Hope it helps.

+3


source







All Articles