2

I try to deploy my QT Application build on Windows with VC++(Debug mode). I run the application on a PC on which QT is not installed. I also provided some .dll libraries that it requires. Here is the folder layout:

  1. D3DCompiler_43.dll
  2. icudt49.dll
  3. icuin49.dll
  4. icuuc49.dll
  5. libEGLd.dll
  6. libGLESv2d.dll
  7. MyApp.exe
  8. MyApp.ini
  9. Qt5Cored.dll
  10. Qt5Guid.dll
  11. Qt5Widgetsd.dll
  12. plugins
  13. plugins\platform\
  14. plugins\platform\qminimal.dll
  15. plugins\platform\qminimald.dll
  16. plugins\platform\qwindows.dll
  17. plugins\platform\qwindowsd.dll

When i run the application i get an error saying:"Failed to load platform plugin 'windows'. Available platforms are:" I think it can not find a platform to load altough i provided platforms under the plugins folder. I also add the platform path to system path but it didn't solve also. Any suggestion?

xyzt
  • 1,201
  • 4
  • 18
  • 44
  • 2
    While all the answers are already given, I would like to comment. I see that all Qt-libs in your list have `d` at the end, what means that these are *debug* version of them. To reduce files size you may want to deploy *release* build of your app, in that case you will need to distribute *release* versions of Qt libs with it (without `d`). – NIA Jan 29 '13 at 08:12
  • 1
    I have similar problems. Deploying Qt4 was very easy, it only needed QtGui and QtCore. Now we need a dozen more DLLs :( , and even after providing the DLLs it usually doesn't work. – vsz Mar 25 '13 at 10:39

4 Answers4

4

The plugins directory is unnecessary.

Try this structure:

  • ...
  • Qt5Widgetsd.dll
  • platform\
  • platform\qminimal.dll
  • platform\qminimald.dll
  • platform\qwindows.dll
  • platform\qwindowsd.dll
york.beta
  • 1,787
  • 13
  • 16
3

There is a help page which tells in detail how to deploy Qt5 applications for Windows.

The most helpful info from there: There is a Windows deployment tool (windeployqt) which finds all required dlls automatically for you!

FourtyTwo
  • 1,616
  • 2
  • 15
  • 43
2

You can load your plugins at the start of the program main() as follows:

QCoreApplication app(argv, args);    
QString sDir = QCoreApplication::applicationDirPath();
app.addLibraryPath(sDir+"/plugins/platform");
Lwin Htoo Ko
  • 2,326
  • 4
  • 26
  • 38
  • I think this is useful for plugin dlls. But what about the core .dlls? If core .dlls are besides the .exe, then it works but it does not work if it is in another folder.. i also tried adding the folder to path but it did not work.. – xyzt Jan 31 '13 at 14:56
  • 1
    that is usually for plugins. without `core dlls` in same directory with your exe, your application cannot even start. basically, you cannot move core dlls from exe directory to other directory. – Lwin Htoo Ko Feb 01 '13 at 02:01
0

When running Qt in Debug, the output window tells you all the DLLs it loads, and which you then need to inclde in your distribution exe folder.