Reputation: 179
I installed Qt, but its projects (exe files) don't run by themselves. I added the following to path (Windows):
C:\Qt\Qt5.4.1\Tools\mingw491_32\bin;
C:\Qt\Qt5.4.1\Tools\QtCreator\bin;
C:\Qt\Qt5.4.1\5.4\mingw491_32\bin;
C:\Qt\Qt5.4.1\Tools\mingw491_32\i686-w64-mingw32\bin;
C:\Qt\Qt5.4.1\Tools\mingw491_32\opt\bin;
But it still returns error. How can it be solved?
Also by using windeployqt.exe I have nessesary dll files, so with them in the same directory application is running perfectly on any pc, but I could not find where to put them in one place, and application, with its files in the other directory so it would run.
Can it be done? (dll-s are about 22mb, when application with its files 1mb, or less)
Upvotes: 1
Views: 341
Reputation: 138
If you add the QtCreator bin to your path and also the mingw qt,then there are 2 versions of qt there. QtCreator might have been compiled with a different version of Qt to what you have, so try removing it from your path.
This line C:\Qt\Qt5.4.1\5.4\mingw491_32\bin;
Should be enough to reference all the Qt dlls.
Upvotes: 0
Reputation: 4369
If you want to find all dlls files your app needs - use dependency walker tool. It will show you what dlls are missing and You can set PATH to cover all needs.
If you want to share your application with others You will need to add all dlls. You have already found the right way of doing it (windeployqt).
If you want to separate exe of your app with Qt's dll files it may be difficult. You may try to prepare a launcher which will setup PATH to directory with dlls and then run exe from another dir. You may however still have problem because Qt needs not only dlls but also other files (translations, plugins etc). Having exe and all this stuff in one directory is the simples ssolution. Add nice icon to Start menu instead ;)
Upvotes: 1