Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. embed qt dlls in exe
Forum Updated to NodeBB v4.3 + New Features

embed qt dlls in exe

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
9 Posts 2 Posters 2.7k Views 2 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.
  • U Offline
    U Offline
    user4592357
    wrote on last edited by
    #1

    i'm building a small application using visual studio.
    however, i need to provide Qt5Core.dll, Qt5Gui.dll and Qt5Widgets.dll with the .exe.
    is there a way to embed (make a part of) the libs (Qt5Core.lib, etc.) into the executable?

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by mrjj
      #2

      Hi
      Yes its called static linking but it requires a commercial license unless you app is
      open source.

      https://wiki.qt.io/Build_Standalone_Qt_Application_for_Windows

      1 Reply Last reply
      4
      • U Offline
        U Offline
        user4592357
        wrote on last edited by
        #3

        i have the license

        1 Reply Last reply
        0
        • mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by mrjj
          #4

          Super, then you just need to build a static version of Qt and compile app with it.

          1 Reply Last reply
          2
          • U Offline
            U Offline
            user4592357
            wrote on last edited by user4592357
            #5

            actually i only have the installer of qt, but also the libs from the installation. can't i do it using those?

            mrjjM 1 Reply Last reply
            0
            • U user4592357

              actually i only have the installer of qt, but also the libs from the installation. can't i do it using those?

              mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @user4592357
              well you need to get the source code of Qt.
              The installer has option for that.
              You might need to install some extra stuff.

              I found these helpful with visual studio
              https://github.com/fpoussin/Qt5-MSVC-Static

              1 Reply Last reply
              2
              • mrjjM Offline
                mrjjM Offline
                mrjj
                Lifetime Qt Champion
                wrote on last edited by
                #7

                Hi
                No, the version you can download is for dynamic loading only.
                You can only do static if the Qt version is made for that.
                Make sure to use all cores of your pc as else it takes long time to compile :)

                1 Reply Last reply
                1
                • U Offline
                  U Offline
                  user4592357
                  wrote on last edited by
                  #8

                  i built static version of qt using the instructions from here: Build Qt 5.7 Statically Using MSVC.

                  i also setup the kit in qt creator as described in the article. now when i try to build the app, this is what i get:

                  17:45:08: Running steps for project untitled...
                  17:45:08: Starting: "C:\Qt\Static\5.10.1\bin\qmake.exe" C:\Users\user\Documents\untitled\untitled.pro -spec win32-msvc "CONFIG+=qml_debug"
                  Could not find qmake configuration file win32-msvc.
                  Error processing project file: C:\Users\user\Documents\untitled\untitled.pro
                  17:45:08: The process "C:\Qt\Static\5.10.1\bin\qmake.exe" exited with code 3.
                  Error while building/deploying project untitled (kit: Qt 5.10.1 Static)
                  The kit Qt 5.10.1 Static has configuration issues which might be the root cause for this problem.
                  When executing step "qmake"
                  17:45:08: Elapsed time: 00:00.
                  
                  1 Reply Last reply
                  0
                  • mrjjM Offline
                    mrjjM Offline
                    mrjj
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    Hi
                    and its just a new test project ?
                    and you do in fact have the win32-msvc file/folder?

                    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