qmake: qtgui5.dll error



  • i have a hello.cpp file and a hello.pro file. i run:

    qmake hello.pro
    

    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?


  • Lifetime Qt Champion

    Hi,

    Did you setup the command line you are using for Qt ?



  • @SGaist

    no, how should i?


  • Lifetime Qt Champion

    Depending on how you installed Qt, you may already have pre-configured command line shortcuts available through the start menu.


  • Qt Champions 2016

    Alternatively you try to run
    "C:\Qt\5.9.1\msvc2015_64\bin\qtenv2.bat"
    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.



  • @mrjj

    i was able to run the .exe from command line but what about just clicking the .exe?



  • @user4592357
    I imagine you want to deploy your app maybe on machines that do not have Qt installed. Then you probably must use the windeployqt.exe tool as explained here: http://doc.qt.io/qt-5/windows-deployment.html

    The windeployqt.exe tool gives a list of all Qt DLL's your .exe needs, 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 .exe without setting those paths, then the DLL's will not be found.

    I found the windeployqt.exe tool to be quite useful. It helped me solve an error about Qt5Multimediad.dll missing 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.exe helped my solve that problem by showing the full path of the DLL it was trying to locate but couldn't find.


  • Qt Champions 2016

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



  • @mrjj said in qmake: qtgui5.dll error:

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


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.