Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Deploy binary can't find method in DLLs



  • I'm trying to figure out how to create a deployable for Windows. I'm using windeployqt.exe to find the dlls I need for my exe file. None the less, when I try to run from the command line, I get a popup with the message:

    The procedure entry point _ZIs6QDebugRK9QFileInfo could not be located in the dynamic link library.
    

    This doesn't seem to happen when I try the same thing using a new test project, even if it includes a QFileInfo object.

    Any idea why this isn't working?



  • After investigating more, I've discovered that my app also crashes on startup if I try to build and run in release mode through Qt Creator. There are no useful error message - the app simply crashes without even opening the main window.

    The program works well in debug mode, though.


  • Lifetime Qt Champion

    @kitfox such thing can happen, if a wrong DLL version is loaded, because someone copied to the folder or modified the PATH enironment variable.

    Dependency Walker can help you to debug such issues.

    Regards



  • After reworking things, I can now run a release build via the Qt Creator IDE and even from the command line provided my path includes C:\Qt\5.12.3\mingw73_32\bin. However, I need this to be able to run on machines that don't have Qt installed.

    To try and mimic a 'dry' installaton, I commented out C:\Qt\5.12.3\mingw73_32\bin on my PATH. I then ran windeployqt.exe to try to find the DLLs I need, but this seems to skip over libgcc_s_dw2-1.dll and libwinpthread_1.dll. After manually copying these files into my deploy directory from C:\Qt\5.12.3\mingw73_32\bin and trying to run again, I get a lot of errors about procedure entry points not being found in the dll. If I add C:\Qt\5.12.3\mingw73_32\bin back to my path, I can run again.

    Dependency Walker lists these dlls as dependencies:

    qt5core.dll
    qt5gui.dll
    qt5qml.dll
    qt5widgets.dll
    qt5xml.dll
    libgcc_s_dw2-1.dll
    kernel32.dll
    msvcrt.dll
    shell32.dll
    libstdc++-6.dll
    avcodec-58.dll
    avformat-58.dll
    avutil-56.dll
    swresample-3.dll
    swscale-5.dll
    

    The last five dlls are for a third party library. I manually copied them into my deploy directory. Everything else is there too, except for kernel32, msvcrt, shell32 and libstdc++-6 which I presume are system files.

    I'm not sure how to fix this because I'm no longer getting errors that dlls are missing - just that procedure entry points are wrong.


  • Lifetime Qt Champion

    @kitfox

    Yeah, adding Qt\bin folders to PATH can lead to things like this, especially when you have multiple Qt versions installed. So I can only discourage you to do this.

    Do deploy your app, you should use https://doc.qt.io/qt-5/windows-deployment.html

    Regards

    Edit: Beside the DLLs Dependency Walker lists, there are more needed, e.g. the plugins that are loaded at runtime.

    Which modules do you include in your .pro file?



  • @aha_1980 I am using that. It added a lot of files to my deploy directory, but skipped libgcc_s_dw2-1.dll and libwinpthread-1.dll, as I stated above. Also, I have removed the Qt path from PATH. That is what is causing the error. It is the Windows Deployment tool that is giving me invalid files.

    My .pro includes the modules

    QT += core gui
    QT += qml xml
    


  • Turns out I needed to add libstdc++-6.dll to my deploy directory as well. I was able to run after this.


Log in to reply