Qt Application Release Version runs only on development computer. Debug version runs everywhere.
I have been trying to resolve this issue for the past few days with no luck. I am developing a music streaming application in Qt C++ in Windows 8.1 with Qt Creator and I have problems in running it (dynamically) on another machine after creating a release version. I will try to be as clear as possible:
- I have put all the necessary dlls in the proper folders in the installation path
- The application works on development machine (windows 8.1) in debug AND release mode EVEN IF I rename the C:\Qt folder
- The application WORKS in the testing machines (windows vista, XP) in debug mode
- The application DOES NOT work correctly in release mode in testing machines
More specifically: It loads the graphic environment but does not try to fetch the proper song database, it just stays as it is. The GUI is functional. Additionally, when I quit the application, it crashes.
I wasn't able to get any debug messages in either mode, running it from command window. All the dlls are in place, checked with the dependency walker. What confuses me mostly is that the release version runs perfectly on the development machine even if I rename the Qt folder, so it can't be any uninitialized variables or other bug in the code. Please help!
Thank you in advance!
Hi, welcome to devnet.
It loads the graphic environment but does not try to fetch the proper song database, it just stays as it is. The GUI is functional. Additionally, when I quit the application, it crashes.
What confuses me mostly is that the release version runs perfectly on the development machine even if I rename the Qt folder, so it can't be any uninitialized variables or other bug in the code.
Actually, it sounds a lot like a bug in your code. Might as well be uninitialized variables or other undefined behavior that happens to work on dev machine. The only thing that gives some hint that it might be a case of bad deployment are your words "does not try to fetch the proper song database". I can't really guess what your code does but it sounds like you're using some database. In that case did you deploy the right sql plugin too?
Can you give in ditails a list of what and where is placed in the installation directory?
When using dependency walker did you use the runtime profiling feature or just opened your app executable? Some Qt components (like database and platfrom plugins) are loaded at runtime and can only be detected by profiling.
So the problem, as you see it, is that it does not fetch the song database. So you need to get into more detail why not. Have you tired to put logging or any messageBox'es about what is the return values of the various functions that re supposed to populate the song database? One of those functions is not working properly, one would suppose.
I solved it using message boxes. No, everything was correctly placed, except a new bool variable I had and wasn't initialized. Everything seems to be working now, at last. Thank you for your help! Just for the record, for anybody that might hit this topic, my file structure for a release version that works correctly on every computer is:
(any dlls for images such as qico.dll)
(dsengine.dll or other usefull for media playback)
qsqlmysql.dll (driver for a database)
libmysql.dll (necessary with mysql driver)
All the other necessary .dlls (follow this guide to collect them): [https://wiki.qt.io/Deploy_an_Application_on_Windows]
Thank you for your help,
Have a nice day!