Hullu2000
Hullu2000

Reputation: 261

Deploy Qt program to Windows from Linux

I'm developing a Qt program on Linux which I would like to puplish on Windows too. Compiling and static linking for Windows works well with MXE (qtbase installed) how ever I'd like to link my program dynamically.

Dynamic linking works and the program runs under Wine but when I copy the EXE and the DLLs to Windows the program gives an error: 'This application failed to start because it could not find or load the Qt platform plugin "windows" in "".'

On Windows there's windeployqt that puts everything that the application needs to run neatly in one folder. Is there a way for getting this tool (or similar) running on Linux?

Upvotes: 1

Views: 1582

Answers (1)

Elcan
Elcan

Reputation: 824

You're missing several files needed around the executable.

Get them under "Qt Dir \ Qt Version \ MinGW Version \ plugins \"

Required :

  • imageformats\
    • qgif.dll
    • qico.dll
    • qjpeg.dll
    • qwbmp.dll
  • platforms\
    • qwindows.dll (that's what the error is talking about)

(if in Debug mode, use these files with a "d" at the end, for example qwindowsd.dll)

I'm not sure about the imageformats, but I had to use them even in programs not using pictures. Try with "platforms\qwindows.dll" first, then add the imageformats if the programs asks to.

See https://doc.qt.io/qt-5/windows-deployment.html for the full info and more precise options. I'm just giving you the explanation.

Upvotes: 2

Related Questions