Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. how to solve the error when the application is opened on another laptop
Qt 6.11 is out! See what's new in the release blog

how to solve the error when the application is opened on another laptop

Scheduled Pinned Locked Moved Unsolved General and Desktop
13 Posts 7 Posters 1.3k Views 4 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Blackzero

    I have a problem with the MSVC2019 compiler after doing windeployqt, the application opens properly on my laptop after deploying, but when other laptops open it errors occur etc. as below, I have used 2 ways to deploy yes it does set VCINSTALLDIR and does not set VCINSTALLDIR, but both as usual it works for my laptop but does not work for other laptops, how to solve this

    WhatsApp Image 2024-06-20 at 20.10.18_6d59c15f.jpg WhatsApp Image 2024-06-20 at 20.11.12_140c6360.jpg WhatsApp Image 2024-06-20 at 20.11.37_232c0eb7.jpg WhatsApp Image 2024-06-20 at 20.12.03_ad4a107f.jpg

    Method 1

    C:\Qt\5.15.2\msvc2019_64\bin>windeployqt.exe --release "C:\Users\User\Documents\Project\MyExe.exe"
    C:\Users\User\Documents\Project\MyExe.exe 64 bit, release executable
    Adding Qt5Svg for qsvgicon.dll
    Skipping plugin qtvirtualkeyboardplugin.dll due to disabled dependencies (Qt5Qml Qt5Quick).
    Skipping plugin qtvirtualkeyboard_hangul.dll due to disabled dependencies (Qt5Qml Qt5Quick).
    Skipping plugin qtvirtualkeyboard_openwnn.dll due to disabled dependencies (Qt5Qml Qt5Quick).
    Skipping plugin qtvirtualkeyboard_pinyin.dll due to disabled dependencies (Qt5Qml Qt5Quick).
    Skipping plugin qtvirtualkeyboard_tcime.dll due to disabled dependencies (Qt5Qml Qt5Quick).
    Skipping plugin qtvirtualkeyboard_thai.dll due to disabled dependencies (Qt5Qml Qt5Quick).
    Direct dependencies: Qt5Core Qt5Gui Qt5Widgets
    All dependencies   : Qt5Core Qt5Gui Qt5Widgets
    To be deployed     : Qt5Core Qt5Gui Qt5Svg Qt5Widgets
    Warning: Cannot find Visual Studio installation directory, VCINSTALLDIR is not set.
    Updating Qt5Core.dll.
    Updating Qt5Gui.dll.
    Updating Qt5Svg.dll.
    Updating Qt5Widgets.dll.
    Updating libGLESv2.dll.
    Updating libEGL.dll.
    D3Dcompiler_47.dll is up to date.
    opengl32sw.dll is up to date.
    Updating qsvgicon.dll.
    Updating qgif.dll.
    Updating qicns.dll.
    Updating qico.dll.
    Updating qjpeg.dll.
    Updating qsvg.dll.
    Updating qtga.dll.
    Updating qtiff.dll.
    Updating qwbmp.dll.
    Updating qwebp.dll.
    Updating qwindows.dll.
    Updating qwindowsvistastyle.dll.
    Creating qt_ar.qm...
    Creating qt_bg.qm...
    Creating qt_ca.qm...
    Creating qt_cs.qm...
    Creating qt_da.qm...
    Creating qt_de.qm...
    Creating qt_en.qm...
    Creating qt_es.qm...
    Creating qt_fi.qm...
    Creating qt_fr.qm...
    Creating qt_gd.qm...
    Creating qt_he.qm...
    Creating qt_hu.qm...
    Creating qt_it.qm...
    Creating qt_ja.qm...
    Creating qt_ko.qm...
    Creating qt_lv.qm...
    Creating qt_pl.qm...
    Creating qt_ru.qm...
    Creating qt_sk.qm...
    Creating qt_tr.qm...
    Creating qt_uk.qm...
    Creating qt_zh_TW.qm...
    

    Method 2

    C:\Qt\5.15.2\msvc2019_64\bin>set VCINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC
    
    C:\Qt\5.15.2\msvc2019_64\bin>windeployqt.exe --release "C:\Users\User\Documents\Project\MyExe.exe"
    C:\Users\User\Documents\Project\MyExe.exe 64 bit, release executable
    Adding Qt5Svg for qsvgicon.dll
    Skipping plugin qtvirtualkeyboardplugin.dll due to disabled dependencies (Qt5Qml Qt5Quick).
    Skipping plugin qtvirtualkeyboard_hangul.dll due to disabled dependencies (Qt5Qml Qt5Quick).
    Skipping plugin qtvirtualkeyboard_openwnn.dll due to disabled dependencies (Qt5Qml Qt5Quick).
    Skipping plugin qtvirtualkeyboard_pinyin.dll due to disabled dependencies (Qt5Qml Qt5Quick).
    Skipping plugin qtvirtualkeyboard_tcime.dll due to disabled dependencies (Qt5Qml Qt5Quick).
    Skipping plugin qtvirtualkeyboard_thai.dll due to disabled dependencies (Qt5Qml Qt5Quick).
    Direct dependencies: Qt5Core Qt5Gui Qt5Widgets
    All dependencies   : Qt5Core Qt5Gui Qt5Widgets
    To be deployed     : Qt5Core Qt5Gui Qt5Svg Qt5Widgets
    Qt5Core.dll is up to date.
    Qt5Gui.dll is up to date.
    Qt5Svg.dll is up to date.
    Qt5Widgets.dll is up to date.
    libGLESv2.dll is up to date.
    libEGL.dll is up to date.
    D3Dcompiler_47.dll is up to date.
    opengl32sw.dll is up to date.
    Updating vc_redist.x64.exe.
    qsvgicon.dll is up to date.
    qgif.dll is up to date.
    qicns.dll is up to date.
    qico.dll is up to date.
    qjpeg.dll is up to date.
    qsvg.dll is up to date.
    qtga.dll is up to date.
    qtiff.dll is up to date.
    qwbmp.dll is up to date.
    qwebp.dll is up to date.
    qwindows.dll is up to date.
    qwindowsvistastyle.dll is up to date.
    Creating qt_ar.qm...
    Creating qt_bg.qm...
    Creating qt_ca.qm...
    Creating qt_cs.qm...
    Creating qt_da.qm...
    Creating qt_de.qm...
    Creating qt_en.qm...
    Creating qt_es.qm...
    Creating qt_fi.qm...
    Creating qt_fr.qm...
    Creating qt_gd.qm...
    Creating qt_he.qm...
    Creating qt_hu.qm...
    Creating qt_it.qm...
    Creating qt_ja.qm...
    Creating qt_ko.qm...
    Creating qt_lv.qm...
    Creating qt_pl.qm...
    Creating qt_ru.qm...
    Creating qt_sk.qm...
    Creating qt_tr.qm...
    Creating qt_uk.qm...
    Creating qt_zh_TW.qm...
    
    jsulmJ Offline
    jsulmJ Offline
    jsulm
    Lifetime Qt Champion
    wrote on last edited by
    #2

    @Blackzero You're trying to run a debug build which requires debug versions of libraries it depends on (like the VCRUNTIME). You should deploy release builds of your app not debug. If you really want to deploy debug builds then also provide debug versions of these libraries.

    https://forum.qt.io/topic/113070/qt-code-of-conduct

    B 1 Reply Last reply
    1
    • jsulmJ jsulm

      @Blackzero You're trying to run a debug build which requires debug versions of libraries it depends on (like the VCRUNTIME). You should deploy release builds of your app not debug. If you really want to deploy debug builds then also provide debug versions of these libraries.

      B Offline
      B Offline
      Blackzero
      wrote on last edited by Blackzero
      #3

      @jsulm So I have to build the release in qt creator and then redo the deploy with --release?

      Pl45m4P 1 Reply Last reply
      0
      • B Blackzero

        @jsulm So I have to build the release in qt creator and then redo the deploy with --release?

        Pl45m4P Offline
        Pl45m4P Offline
        Pl45m4
        wrote on last edited by
        #4

        @Blackzero said in how to solve the error when the application is opened on another laptop:

        So I have to build the release in qt creator

        Yes.
        Debug build expects *_D or *d debug libraries and release the release libs (e.g. without debug symbols).


        If debugging is the process of removing software bugs, then programming must be the process of putting them in.

        ~E. W. Dijkstra

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #5

          Hi,

          One detail that comes from the top of my head, the debug version of the MSVC runtime are not redistributable.
          One alternative is to do a release with debug information build.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          B 1 Reply Last reply
          0
          • SGaistS SGaist

            Hi,

            One detail that comes from the top of my head, the debug version of the MSVC runtime are not redistributable.
            One alternative is to do a release with debug information build.

            B Offline
            B Offline
            Blackzero
            wrote on last edited by
            #6

            @SGaist What does that mean? How to do that?

            1 Reply Last reply
            0
            • MesrineM Offline
              MesrineM Offline
              Mesrine
              wrote on last edited by
              #7

              If you are using CMake adding
              include(InstallRequiredSystemLibraries)
              will install VCRuntime* dependencies in the install step.

              J.HilkJ B 2 Replies Last reply
              0
              • MesrineM Mesrine

                If you are using CMake adding
                include(InstallRequiredSystemLibraries)
                will install VCRuntime* dependencies in the install step.

                J.HilkJ Offline
                J.HilkJ Offline
                J.Hilk
                Moderators
                wrote on last edited by
                #8

                @Mesrine seriously !? oO

                Maybe its time to switch to cmake after all


                Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                Q: What's that?
                A: It's blue light.
                Q: What does it do?
                A: It turns blue.

                B 1 Reply Last reply
                0
                • MesrineM Mesrine

                  If you are using CMake adding
                  include(InstallRequiredSystemLibraries)
                  will install VCRuntime* dependencies in the install step.

                  B Offline
                  B Offline
                  Blackzero
                  wrote on last edited by
                  #9

                  @Mesrine I use qmake, how is the code if in qmake

                  1 Reply Last reply
                  0
                  • J.HilkJ J.Hilk

                    @Mesrine seriously !? oO

                    Maybe its time to switch to cmake after all

                    B Offline
                    B Offline
                    Blackzero
                    wrote on last edited by
                    #10

                    @J-Hilk
                    I have too much code that makes it impossible to move to cmake, is it possible to change qmake to cmake easily without having to redo the code

                    Christian EhrlicherC J.HilkJ 2 Replies Last reply
                    0
                    • B Blackzero

                      @J-Hilk
                      I have too much code that makes it impossible to move to cmake, is it possible to change qmake to cmake easily without having to redo the code

                      Christian EhrlicherC Offline
                      Christian EhrlicherC Offline
                      Christian Ehrlicher
                      Lifetime Qt Champion
                      wrote on last edited by
                      #11

                      @Blackzero said in how to solve the error when the application is opened on another laptop:

                      without having to redo the code

                      You don't have to change code when you change the build system.

                      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                      Visit the Qt Academy at https://academy.qt.io/catalog

                      1 Reply Last reply
                      1
                      • B Blackzero

                        @J-Hilk
                        I have too much code that makes it impossible to move to cmake, is it possible to change qmake to cmake easily without having to redo the code

                        J.HilkJ Offline
                        J.HilkJ Offline
                        J.Hilk
                        Moderators
                        wrote on last edited by
                        #12

                        @Blackzero the correct way to ship those particular dependencies that seem to be missing, is actually by having the user install those runtimes themselves:
                        https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170

                        or by shipping the installer yourself (you're explicitly allowed to do that) and executing it during your app install process.


                        Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                        Q: What's that?
                        A: It's blue light.
                        Q: What does it do?
                        A: It turns blue.

                        SGaistS 1 Reply Last reply
                        2
                        • J.HilkJ J.Hilk

                          @Blackzero the correct way to ship those particular dependencies that seem to be missing, is actually by having the user install those runtimes themselves:
                          https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170

                          or by shipping the installer yourself (you're explicitly allowed to do that) and executing it during your app install process.

                          SGaistS Offline
                          SGaistS Offline
                          SGaist
                          Lifetime Qt Champion
                          wrote on last edited by
                          #13

                          @J-Hilk except that the error message talks about the debug version of the runtime which is not redistributable. More information here.

                          @Blackzero if using qmake:

                          CONFIG += force_debug_info
                          

                          If using cmake:

                          CMAKE_BUILD_TYPE=RelWithDebInfo
                          

                          Interested in AI ? www.idiap.ch
                          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                          1 Reply Last reply
                          1

                          • Login

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • Users
                          • Groups
                          • Search
                          • Get Qt Extensions
                          • Unsolved