Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Qt libraries conflict in Windows
xtingray last edited by
I have detected a problem with my Qt application in Windows:
My installer defines several variables in the system and adds some library paths into the PATH variable. On the other hand, the launcher just call the app executable (app.exe) directly. If there are no other Qt applications installed in the system, my app works perfectly, but if there are others, then when I try to run the app I got this message: "The procedure entry point could not be located in the dynamic link library".
Here some examples of the error message:
I am guessing that there is a conflict between the Qt library versions. How can I avoid this problem? Any suggestion?
adds some library paths into the PATH variable
Why? This can easily break other software.
Wouldn't http://doc.qt.io/qt-5/qt-conf.html be better?
After reading the documentation it isn't clear for me if the qt.conf file must be loaded from my application code or if it just have to be located in the same directory of my app.exe file to work.
I made some unsuccessful tests creating several versions of my qt.conf file, moving it from folder to folder with no luck. This is one of those versions:
[Paths] Prefix=C:\Program Files\MyApp\bin Libraries=lib;lib\qt5;lib\support
Now, this is the directory tree of my app:
app\ app\bin\app.exe app\lib\ app\lib\qt5 app\lib\support
What should be the content of my qt.conf file to make it work and where should I locate it? Do I have to do something inside my main.cpp too?
Thank you for your help!
@xtingray I would say it should be
[Paths] Prefix=C:/Program Files/MyApp Libraries=lib;lib/qt5;lib/support
Sorry, I already tried it but it didn't work :(
I found a non so elegant solution for my problem: to copy all the library dll files in the same directory of my app.exe file. Even more, without editing the PATH variable I can launch my application successfully, but as I need to run some specific tests while I am deploying the application, it would be great if I can locate all the .dll files in a different directory than the app executable.
If to use the qt.conf file only requires to put it in the same directory of the .exe file, the instruction is very basic indeed, but it isn't working for me :/
Finally I could solve my problem using a .bat launcher for my app:
set path=..\lib;..\lib\qt5;..\lib\support app.exe
Now, it doesn't matter where path I choose to install my app, I can launch it without modifying the PATH variable of the system.