Reputation: 4275
When trying to run windeployqt.exe
, how does it know where to look for the Qt Libraries?
I'm using Windows, Qt 5.3, msvc2013_opengl.
I have the following setup:
C:/PathA/Qt/5.3
. It worked fine there.C:/PathB/Qt/5.3
C:/PathA/
to C:/PathC/
to "hide" the old place.When running C:/PathB/Qt/5.3/.../windeployqt.exe
it complains, that it can not read file C:/PathA/.../QtPrintSupport.dll
- of course, because that file does not exist anymore....
I tried:
PathA
from environment variables and rebooted.PathA
.PathB
and PathC
- both contain relative paths.qmake -query
.qmake.exe -query
- they return PathB
and PathC
as expected.Still, windeployqt insists on searching C:/PathA
- so where does it get that value from?
PS: I know that i could try to uninstall all Versions of Qt, get rid of everything Qt-related and reinstall it from scratch. However thats not what i'm interested in. I'm interested in allowing multiple Versions of Qt installed next to each other and controlling, which one to use (Using CMake and Visual Studio).
Edit:
In contrast to this question, i'm not using QtCreator and the scope of this question is not "How to install multiple Versions of Qt when using QtCreator?". The question is specifically "Where does windeployqt.exe
get the path to the Qt libraries?"
Upvotes: 0
Views: 1804
Reputation: 4275
As far as i can tell, the order is this:
qmake.exe
with a qt.conf
file is found in one of the directories in PATH, windeployqt
uses <path to qmake&qt.conf>/<prefix in qt.conf>/bin
qmake.exe
is found in the same directory as windeployqt.exe
, the hardcoded path qt_binspath
in qmake.exe
is usedqmake.exe
is found in PATH, the qt_binspath
there is usedwindeployqt
fails with "Unable to query qmake: CreateProcessW failed"Thanks to Pedro for his hint about the hardcoded values and the suggestion to use a hex editor.
Upvotes: 1
Reputation: 2576
Quoting this page:
windeployqt takes an .exe file or a directory that contains an .exe file as an argument, and scans the executable for dependencies... Identified dependencies are then copied to the executable's directory. The hardcoded local paths in Qt5Core.dll are furthermore replaced with relative ones.
So probably you are looking for these hardcoded paths in Qt5Core.dll, you may use an hex editor to look for "qt_prfxpat".
Upvotes: 1