dll procedure entry point not found when directly executing qt application

  • Hello,
    I use windows 8.1 64-bit with dynamic qt 5.4 and mingw GCC 4.9.2.
    When I build and run my 64 bit qt application from within qtcreator everything works fine. But when executing the .exe directly in the directory where qtcreator placed it, I receive a procedure entry point "inflateReset2" not found in my mingw64\bin\libpng16-16.dll.

    My guess was that another version of the dll exists in my system but I failed to find one. The only existing one is the correct one in my mingw64 bin folder.

    Why does this error occur and why does it not occur when starting from within qtcreator?

    Any help is appreciated.

  • Hi, on a vanilla Windows system, when you install Qt, you can not execute your Qt applications from outside QtCreator. This is because the paths to Qt's DLLs is not set.

    There is a .bat file you can start from CMD, called qtenv2.bat that will setup those paths for you, on my PC it's in C:\Qt\5.4\mingw491_32\bin.

  • Thanks for the hint. On my system I used msys2 to install Qt. The qtenv2.bat is not created during installation, but the path to Qt's DLLs is automatically added to the PATH variable: path\to\msys2\mingw64\bin.
    So, does that mean there is another path missing? Although the error message does not look like it ...

  • Hmm, perhaps you have two different Qt DLLs installed, so when Qt Creator launches your app, it sets the path to somewhere else than what msys2 installed for you.

    If you google for that entry point "inflateReset2" it's in a library called zlib which usually is included in Qt, but maybe msys2 installed a version of Qt without it...

  • Hello. I coincidently came across the same problem recently when trying to configure qt5 using msys2.
    It confused me a lot because only when I placed the newest zlib1.dll in the same directory where the execute file was can the execute file launch without warning.
    Eventually I solved the problem by deleting the old-version zlib1.dll placed in system32. It is because the useless zlib1.dll conflicts with the newest one which is really needed that the problem appears. If you also find a zlib1.dll in system32, you can try deleting it and the problem might be solved.
    Sorry for my poor English, which is my second language.

Log in to reply

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