How to run Qt 5 applications on other computers (Windows 7)

后端 未结 4 1608
隐瞒了意图╮
隐瞒了意图╮ 2020-12-15 23:59

I have developed a simple application with Qt 5.0.2 on Windows 7 Ultimate. As a compiler the QtCreator used MSVC2012_64bit. And I cannot move my application onto other compu

4条回答
  •  感情败类
    2020-12-16 00:42

    Qt these days (as of at least Qt 5.2, if not earlier) ships with "windeployqt.exe", which when pointed at your compiled program (and, if like me you're using them, as an additional argument of "--qmldir path/to/QML/files" for a Qt Quick program) should spit out all the required DLLs into the same directory as your compiled program currently resides. So for myself on a local build machine for example, I ran something along the lines of:

        windeployqt --qmldir C:\Code\AppSource C:\Code\build-msvc2010\release
    

    This is with the Qt \bin directory in my $PATH (or, I guess in Windows parlance, %PATH% ;)) using Qt 5.5, although I've done the same back with 5.2 and 5.3 as well.

    IIRC if using MSVC as the compiler I still needed to copy those DLLs (in my case, msvc2010, so msvcp100.dll and msvcr100.dll) manually, but I could be remembering wrong.

提交回复
热议问题