allin0n3 allin0n3 - 1 year ago 115
C++ Question

Running Qt app on different computers

I've just finished my first Qt program. I compiled it with MinGW 32bit compiler.
On my computer I have installed all necessary dll files when I was installing Qt.

After Profile/Debug/Release I can successfully run the app on my computer.

On second computer (also Windows 10) I'm getting errors about missing dll files.
Qtguid.dll, qtwidgets and many more. I tried to put some missing dll files to the program directory. New errors occurred, like 0xc00007b.

What can I do to solve these problems with dll files? What can I do to make this app be able to run on different PCs?

Answer Source

If you are compiling your app under Windows, 32bit version it's completly compatible with x64 bits version. There is no problem running the app in Windows 7 or 10 if you are using only Qt dlls.

I recommend you to check Qt Deployment Documentation and use windeployqt to get all required dll files. Basically:

  1. Compile your app in Release mode.
  2. Create a new folder and copy your generated exe file to this folder.
  3. Acces to the Qt Mingw32 (or MSVC) command promp and go to the folder and run:

    cd C:/myFolder windeployqt .

Windeployqt will copy all required files in this folder. When the process finished, just run the app. Compress the folder in rar or zip and test it in other computers.

  • If the problem still happens, use DependencyWalker to check the required dlls. Copy the required files in the folder.
  • When all works fine, you can use InnoSetup to create an installer.
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download