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?

2
  • 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). Commented Jan 29, 2013 at 8: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. Commented Mar 25, 2013 at 10:39

4 Answers 4

4

The plugins directory is unnecessary.

Try this structure:

  • ...
  • Qt5Widgetsd.dll
  • platform\
  • platform\qminimal.dll
  • platform\qminimald.dll
  • platform\qwindows.dll
  • platform\qwindowsd.dll
Sign up to request clarification or add additional context in comments.

Comments

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!

Comments

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");

2 Comments

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..
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.
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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.