qmake: qtgui5.dll error
i have a hello.cpp file and a hello.pro file. i run:
which generated some files. i cd-ed to release directory and tried to run the exe but got
the procedure entry point _ZdaPvj could not be loaded in the dynamic library C:\Qt\5.8\mingw53_32\bin\Qt5Gui.dll
what am i doing wrong?
Did you setup the command line you are using for Qt ?
no, how should i?
Depending on how you installed Qt, you may already have pre-configured command line shortcuts available through the start menu.
Alternatively you try to run
For you it would be in the mingw53_32 folder
At least here, it allows me to run exe from commandline if i run it.
without it i get error about missing dlls.
i was able to run the .exe from command line but what about just clicking the .exe?
I imagine you want to deploy your app maybe on machines that do not have Qt installed. Then you probably must use the
windeployqt.exetool as explained here: http://doc.qt.io/qt-5/windows-deployment.html
windeployqt.exetool gives a list of all Qt DLL's your
.exeneeds, so, if you only intend to use your app on your PC, then you could instead make sure the path to all those DLLs is in your system path... Qt Creator does that for you when you launch the app from it, but if you directly click on the
.exewithout setting those paths, then the DLL's will not be found.
I found the
windeployqt.exetool to be quite useful. It helped me solve an error about
Qt5Multimediad.dllmissing or so. The tool indicated that it was trying to find the .dll in an old Python directory in which I used to have a Qt installation. This old path
E:/Python34/Lib/site-packages/PyQt5/was still in my system PATH, which I did not realize.
windeployqt.exehelped my solve that problem by showing the full path of the DLL it was trying to locate but couldn't find.
Its important to understand that clicking the exe demands that it has its support DLLS in same folder.
Its called a deployment folder. While its possible to add path so clicking the exe works, its
a very bad idea as other application might load wrongs dlls due to that.
So as @Diracsbracket says, you an use the tool to create such folder and run the exe from there.
While its possible to add path so clicking the exe works, its
a very bad idea as other application might load wrongs dlls due to that
I agree. Another solution is to create a script file (e.g. using VBScript) that sets up a temporary environment for your app, including all the paths it needs, and then launches your app. But all that of course is unnecessary if you only intend to use the app yourself: if your app is completed and only for personal usage, then its easier to create the deployment folder. If its for testing, then its simpler to launch it from Qt Creator anyway, so...