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 bundle all the system dll and lib for my qt program?
Forum Updated to NodeBB v4.3 + New Features

how to bundle all the system dll and lib for my qt program?

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 7 Posters 142 Views 1 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.
  • M Offline
    M Offline
    MonkeyBusiness
    wrote on last edited by
    #1

    Wrote a simple timer, and when people run it on their computer its missing VCRUNTIME140.dll along with a bunch of others, it is not possible to find them all and mistake could be made if done manually. I want to know if qt provides ways to deploy all required dll and lib with my program? best if I could make it into a installer as well.

    1 Reply Last reply
    0
    • J Offline
      J Offline
      Jyothi
      wrote on last edited by
      #2

      For VCRUNTIME140.dll, Once go through this link....https://helpdeskgeek.com/how-to-fix-a-vcruntime140-dll-is-missing-error-on-windows-10/.....I don't know if this works, just try it out.....

      For other dlls, are those related to qt like, qt related dlls u can find them in qt_folder/qt_version/project_compiler_version/....normally in this path you will find required dlls......

      My suggestion is that don't copy all dlls, because it will consume too much storage. When you double click on the application (In Windows PC), you will get few warnings stating the missing dlls. those missing dlls can be found at qt_folder/qt_version/project_compiler_version/....make sure you copy the dlls from compiler folder which you used to compile the project

      Hope this helps....

      Christian EhrlicherC 1 Reply Last reply
      0
      • J Jyothi

        For VCRUNTIME140.dll, Once go through this link....https://helpdeskgeek.com/how-to-fix-a-vcruntime140-dll-is-missing-error-on-windows-10/.....I don't know if this works, just try it out.....

        For other dlls, are those related to qt like, qt related dlls u can find them in qt_folder/qt_version/project_compiler_version/....normally in this path you will find required dlls......

        My suggestion is that don't copy all dlls, because it will consume too much storage. When you double click on the application (In Windows PC), you will get few warnings stating the missing dlls. those missing dlls can be found at qt_folder/qt_version/project_compiler_version/....make sure you copy the dlls from compiler folder which you used to compile the project

        Hope this helps....

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

        @Jyothi said in how to bundle all the system dll and lib for my qt program?:

        My suggestion is that don't copy all dlls, because it will consume too much storage. When you double click on the application (In Windows PC), you will get few warnings stating the missing dlls. those missing dlls can be found at qt_folder/qt_version/project_compiler_version/....make sure you copy the dlls from compiler folder which you used to compile the project

        Hope this helps....

        ... or simply use windeployqt

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

        R 1 Reply Last reply
        1
        • Christian EhrlicherC Christian Ehrlicher

          @Jyothi said in how to bundle all the system dll and lib for my qt program?:

          My suggestion is that don't copy all dlls, because it will consume too much storage. When you double click on the application (In Windows PC), you will get few warnings stating the missing dlls. those missing dlls can be found at qt_folder/qt_version/project_compiler_version/....make sure you copy the dlls from compiler folder which you used to compile the project

          Hope this helps....

          ... or simply use windeployqt

          R Offline
          R Offline
          Redman
          wrote on last edited by
          #4

          @Christian-Ehrlicher To add to this: if you use cmake you can find the correct approach here https://www.qt.io/blog/cmake-deployment-api

          1 Reply Last reply
          0
          • C Offline
            C Offline
            ChrisW67
            wrote on last edited by
            #5

            That specific missing file (along with other things is comes with) should be installed using the Microsoft runtime installer available here: Latest Microsoft Visual C++ Redistributable Version rather than reinventing that particular wheel.

            1 Reply Last reply
            0
            • T Offline
              T Offline
              Thasneem
              wrote on last edited by
              #6

              You can use windeployqt to identify the dependencies and wrap it together and create a zip2exe installation package out of it .
              Please refer
              https://doc.qt.io/qt-6/windows-deployment.html

              1 Reply Last reply
              0
              • Paul ColbyP Offline
                Paul ColbyP Offline
                Paul Colby
                wrote on last edited by
                #7

                Hi @MonkeyBusiness,

                I want to know if qt provides ways to deploy all required dll and lib with my program?

                As others have said, the answer is yes. You can read more about it here: https://doc.qt.io/qt-6/windows-deployment.html

                Since you asked specifically about VCRUNTIME140.dll it's worth explaining a bit more. windeployqt will collect a few different things for you application (not an exhaustive list):

                1. the Qt libraries your application depends on (if they can be detected);
                2. the Qt plugins in your application depends on (if they can be detected);
                3. the VC runtime redistributable.

                Now, the VCRUNTIME140.dll you mentioned is part of that #3. Specifically, as I understand it, Microsoft does not allow applications to distribute and install VC runtimes in any way other than via their own .exe installer. So, windeployqt will pull the VC redist installer (typically vc_redist.x64.exe) from the OS, and put it with your application (unless you use the --no-compiler-runtime option to skip it). It is then your responsibility to run that installer, if the required runtime is not already installed, either manually, or as part of your own application installer.

                Here's a bit of how the Qt6 docs describe it:

                For Windows desktop applications, the required runtime files for the compiler are also copied to the deployable folder by default (unless the option --no-compiler-runtime is specified). In the case of release builds using Microsoft Visual C++, these consist of the Visual C++ Redistributable Packages, which are intended for recursive installation by the application's installer on the target machine.

                So, in summary:

                1. use windeployqt to collect the libraries, and runtime, needed for the app (tip: you might find --release and --compiler-runtime options helpful)
                2. distribute the resulting file set however you like (zip it, write a Qt Installer Framework installer, create an *.msi file, etc)
                3. when/after installing, run the included vc_redist.x64.exe - either manually, or via your own installer.

                There are other ways to do it (including commercial install tools etc), but that's the most basic way, as far as I understand it.

                Cheers.

                1 Reply Last reply
                0

                • Login

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