0
votes

I just Build my Project and now when i click the executable file (.exe), i gives errors that some .dll files are missing, so i referred this page https://doc.qt.io/qt-5/windows-deployment.html which says that i can use Windows Deployment Tool, which is found in QTDIR/bin/windeployqt folder directory, but when i go to the path in the image c\Qt\5.14.1 enter image description here

i see that i have all these folders and all of them have bin folders, so to solve this i i went into visual studio , Extensions->QT VS Tools-> Qt options and this thing shows up ,where i got to know the version i am using enter image description here

so, i opened command prompt and did this enter image description here

After that, in my applications .exe folder, i see some more .dll files being added, but still i get the same errors missing Qt5Widgets.dll,Qt5Core.dll,Qt5Gui.dll, i have all of those but the name ends with d, should i try renaming them ?

enter image description here

1
1) set PATH=<qt-path> completely replaces the existing PATH, you probably want set PATH=<qt-path>;%PATH% to add to it, instead. 2) "VCINSTALLDIR is not set" means the VS environment is not set, you need to run that at the VS developer prompt, instead. 3) "GafUI.exe 64 bit, debug" shows that QT misidentifies your .exe as being a debug build, possibly because of 1) and 2), which causes it to copy the debug DLLs over (those with the "d" suffix) instead of the release ones that the .exe requires. - dxiv
No problem with the qt.conf file per se, but you'll need to remember to update it if you ever move QT to a different directory, and also tell friends to (install QT and) do the same if they want to run your app. - dxiv
@the_learnist Yes, you would need to include the QT runtimes that your app depends on. For a real life example, take a look at the .zip distribution of xnview mp to see how they do it (but your list of DLLs would not necessarily be the same as theirs). - dxiv
@the_learnist vcruntime140d.dll and the other "d" ones are debug dlls. They are not redistributable, and you should not send out debug builds, anyway. As to why windeployqt mistakes your .exe for a debug build, that I don't know but it seems you can override that with the --release command line switch, and then it should copy the right set of non-debug dlls. - dxiv
@the_learnist That would be my reading of the linked page, yes. - dxiv

1 Answers

0
votes

I have solved this by placing qt.conf file in my application's .exe folder

[Paths]
Prefix=C:\Qt\5.14.1\msvc2017_64

Defining Prefix in your qt.conf file allows it to find the qwindows.dll platform plugin when your app starts.