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. Qt shared with static runtime license question
QtWS25 Last Chance

Qt shared with static runtime license question

Scheduled Pinned Locked Moved Solved General and Desktop
17 Posts 4 Posters 1.8k Views
  • 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.
  • Cobra91151C Offline
    Cobra91151C Offline
    Cobra91151
    wrote on last edited by
    #1

    Hi! I want to know, will Qt license be violated when I use the shared Qt with static runtime? Static runtime means only for example Win libs will be embedded into the executable not the Qt libs. Thanks.

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

      Hi,

      You are aware that you'll have to also rebuild Qt to use the static runtime ?

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

      Cobra91151C 1 Reply Last reply
      1
      • SGaistS SGaist

        Hi,

        You are aware that you'll have to also rebuild Qt to use the static runtime ?

        Cobra91151C Offline
        Cobra91151C Offline
        Cobra91151
        wrote on last edited by Cobra91151
        #3

        @SGaist

        Yes, I need to rebuild Qt from the source with static runtime. So will the Qt license be violated or not in such case? Thanks.

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

          What license are you referring to ? There are three.

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

          Cobra91151C 1 Reply Last reply
          0
          • SGaistS SGaist

            What license are you referring to ? There are three.

            Cobra91151C Offline
            Cobra91151C Offline
            Cobra91151
            wrote on last edited by
            #5

            @SGaist

            I don't know exactly which one, but I will explain what I want to do. I have the application, it's built with Qt shared libs, but it requires 40 Windows libs to run (components), so I need to manage that additionally every time and it's not easy task. But I want to have it embedded into the executable, so they will always be there. Will I violate any of the Qt licenses if I use shared Qt compilation with a static runtime? Thanks.

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

              Building Qt or any other library against the static runtime of Visual Studio doesn't mean the you are going to get a fully static build of your application regarding the Windows API you might be using. Just that you won't have to distribute the VS runtime dlls (with all the implications it will have regarding security updates of the runtime).

              In any case, it's not the same as building a static version of Qt if you are thinking about the GPL/LGPL license.

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

              Cobra91151C 1 Reply Last reply
              1
              • SGaistS SGaist

                Building Qt or any other library against the static runtime of Visual Studio doesn't mean the you are going to get a fully static build of your application regarding the Windows API you might be using. Just that you won't have to distribute the VS runtime dlls (with all the implications it will have regarding security updates of the runtime).

                In any case, it's not the same as building a static version of Qt if you are thinking about the GPL/LGPL license.

                Cobra91151C Offline
                Cobra91151C Offline
                Cobra91151
                wrote on last edited by
                #7

                @SGaist

                So, I can use it legally. Good. Thank you for the answer.

                jsulmJ 1 Reply Last reply
                0
                • Cobra91151C Cobra91151

                  @SGaist

                  So, I can use it legally. Good. Thank you for the answer.

                  jsulmJ Offline
                  jsulmJ Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  @Cobra91151 If you want to use static Qt build and you do not have commercial license then you will need to make sure you're not violating GPL! With a static Qt build GPL applies, that means you will need to release your app under GPL (or compatible license) as well if you distribute your app.

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

                  JonBJ 1 Reply Last reply
                  0
                  • jsulmJ jsulm

                    @Cobra91151 If you want to use static Qt build and you do not have commercial license then you will need to make sure you're not violating GPL! With a static Qt build GPL applies, that means you will need to release your app under GPL (or compatible license) as well if you distribute your app.

                    JonBJ Online
                    JonBJ Online
                    JonB
                    wrote on last edited by JonB
                    #9

                    @jsulm
                    I think the OP's proposal is a little more complex than that. Read again what @SGaist has posted above.

                    If I understand right, the OP wishes specifically to just avoid distributing the C/C++/VC/MSVC/Win dynamic runtime libraries, while still distributing the Qt libraries as dynamic. Thus, again if I am correct, he wishes to:

                    • Recompile the Qt sources such that the DLLs produced already have the static C/system runtime libraries embedded in them --- no need for MSVCRT.DLL etc. at runtime.

                    • Compile his own sources also to use the static system/C libraries rather than dynamic ones.

                    That's assuming it works this way. I am unsure whether the "embedding" of the static system/C libraries happens separately for the Qt DLLs and his own code as he generates each one, thus producing two separate "copies" within each, or whether it happens only once when his final executable is produced (linked) against the Qt libraries. I also cannot be certain whether there is a problem effectively having two separate copies of the static system/C libraries in the final executable, e.g. are there supposed to be any common, shared variables in the runtime which would now be duplicated and thus not work?

                    I have never mixed static static & shared libraries in the way the OP suggests. I would ask him whether, given that he is prepared to distribute Qt DLLs with his application, it is really worth going to all this trouble in order to avoid distributing the system/C DLLs at the same time? I do not recognise the figure of "it requires 40 Windows libs to run (components)", that seems very high.

                    Although the OP may not need to change any Qt source code, in order to achieve this, if I understand right the OP must compile the sources of Qt himself, to cause static C/system library linkage. That means that I, as an end user, cannot simply "download and plug in" the latest dynamic DLLs of Qt, as I please. I am not a Qt expert or company representative, and have no vested in what the OP does one way or the other. But I would wonder whether this does not contravene the LGPL (for the community version) spirit or terms, which I thought intended to ensure that any (compatible) version of the freely-available Qt shared libraries can be used at runtime?

                    jsulmJ 1 Reply Last reply
                    0
                    • JonBJ JonB

                      @jsulm
                      I think the OP's proposal is a little more complex than that. Read again what @SGaist has posted above.

                      If I understand right, the OP wishes specifically to just avoid distributing the C/C++/VC/MSVC/Win dynamic runtime libraries, while still distributing the Qt libraries as dynamic. Thus, again if I am correct, he wishes to:

                      • Recompile the Qt sources such that the DLLs produced already have the static C/system runtime libraries embedded in them --- no need for MSVCRT.DLL etc. at runtime.

                      • Compile his own sources also to use the static system/C libraries rather than dynamic ones.

                      That's assuming it works this way. I am unsure whether the "embedding" of the static system/C libraries happens separately for the Qt DLLs and his own code as he generates each one, thus producing two separate "copies" within each, or whether it happens only once when his final executable is produced (linked) against the Qt libraries. I also cannot be certain whether there is a problem effectively having two separate copies of the static system/C libraries in the final executable, e.g. are there supposed to be any common, shared variables in the runtime which would now be duplicated and thus not work?

                      I have never mixed static static & shared libraries in the way the OP suggests. I would ask him whether, given that he is prepared to distribute Qt DLLs with his application, it is really worth going to all this trouble in order to avoid distributing the system/C DLLs at the same time? I do not recognise the figure of "it requires 40 Windows libs to run (components)", that seems very high.

                      Although the OP may not need to change any Qt source code, in order to achieve this, if I understand right the OP must compile the sources of Qt himself, to cause static C/system library linkage. That means that I, as an end user, cannot simply "download and plug in" the latest dynamic DLLs of Qt, as I please. I am not a Qt expert or company representative, and have no vested in what the OP does one way or the other. But I would wonder whether this does not contravene the LGPL (for the community version) spirit or terms, which I thought intended to ensure that any (compatible) version of the freely-available Qt shared libraries can be used at runtime?

                      jsulmJ Offline
                      jsulmJ Offline
                      jsulm
                      Lifetime Qt Champion
                      wrote on last edited by
                      #10

                      @JonB My comment is for the case he wants to build Qt statically. I don't see how Qt licensing can be violated if he wants to build libs statically which are unrelated to Qt.

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

                      JonBJ 1 Reply Last reply
                      0
                      • jsulmJ jsulm

                        @JonB My comment is for the case he wants to build Qt statically. I don't see how Qt licensing can be violated if he wants to build libs statically which are unrelated to Qt.

                        JonBJ Online
                        JonBJ Online
                        JonB
                        wrote on last edited by
                        #11

                        @jsulm
                        The OP does not want static Qt, he states explicitly

                        I use the shared Qt with static runtime? Static runtime means only for example Win libs will be embedded into the executable not the Qt libs.

                        He does not want to "build libs statically which are unrelated to Qt.". He wants to build shared, dynamic Qt libraries (DLLs), but he wants to change the Qt build process so that it links with static C/system libraries instead of the dynamic ones which Qt's shared DLLs (e.g. as downloadable from the web) are built for. This assumes that you must change the build process (flags) for Qt libraries in order to cause it to use static C/system ones, not just change your own application's link command, which I believe is the case.

                        jsulmJ 1 Reply Last reply
                        0
                        • JonBJ JonB

                          @jsulm
                          The OP does not want static Qt, he states explicitly

                          I use the shared Qt with static runtime? Static runtime means only for example Win libs will be embedded into the executable not the Qt libs.

                          He does not want to "build libs statically which are unrelated to Qt.". He wants to build shared, dynamic Qt libraries (DLLs), but he wants to change the Qt build process so that it links with static C/system libraries instead of the dynamic ones which Qt's shared DLLs (e.g. as downloadable from the web) are built for. This assumes that you must change the build process (flags) for Qt libraries in order to cause it to use static C/system ones, not just change your own application's link command, which I believe is the case.

                          jsulmJ Offline
                          jsulmJ Offline
                          jsulm
                          Lifetime Qt Champion
                          wrote on last edited by
                          #12

                          @JonB said in Qt shared with static runtime license question:

                          He does not want to

                          OK, my last post was not expressed correctly. Lets do it this way: I don't see how Qt licensing can be violated if he wants to link against static libs which are unrelated to Qt.
                          I know what he wants to do. My post about static Qt and GPL was simply for the case...

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

                          JonBJ 1 Reply Last reply
                          0
                          • jsulmJ jsulm

                            @JonB said in Qt shared with static runtime license question:

                            He does not want to

                            OK, my last post was not expressed correctly. Lets do it this way: I don't see how Qt licensing can be violated if he wants to link against static libs which are unrelated to Qt.
                            I know what he wants to do. My post about static Qt and GPL was simply for the case...

                            JonBJ Online
                            JonBJ Online
                            JonB
                            wrote on last edited by
                            #13

                            @jsulm
                            Fair enough. For anyone reading this, I imagine @jsulm knows better than I do in this area, and his comments should be respected over mine.

                            jsulmJ 1 Reply Last reply
                            0
                            • JonBJ JonB

                              @jsulm
                              Fair enough. For anyone reading this, I imagine @jsulm knows better than I do in this area, and his comments should be respected over mine.

                              jsulmJ Offline
                              jsulmJ Offline
                              jsulm
                              Lifetime Qt Champion
                              wrote on last edited by
                              #14

                              @JonB I don't know whether I know this topic better than you :-)
                              @Cobra91151 I'm not an lawyer, so please don't charge me if you violate any license :-)

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

                              Cobra91151C 1 Reply Last reply
                              1
                              • jsulmJ jsulm

                                @JonB I don't know whether I know this topic better than you :-)
                                @Cobra91151 I'm not an lawyer, so please don't charge me if you violate any license :-)

                                Cobra91151C Offline
                                Cobra91151C Offline
                                Cobra91151
                                wrote on last edited by Cobra91151
                                #15

                                @jsulm

                                Hi! I don't think any Qt licenses will be violated, because these Win libs as you mentioned early are unrelated to Qt.

                                Here is the screenshot of these libs (as example):

                                0_1539856286366_2018-10-18_125103.png

                                By the way, when building static test application with Visual Studio 2017, all of them are embedded. So, I want just to distribute the Qt libs (.dlls).

                                1 Reply Last reply
                                0
                                • Cobra91151C Offline
                                  Cobra91151C Offline
                                  Cobra91151
                                  wrote on last edited by
                                  #16

                                  I have checked this option but it fails to compile. From the configure /help command:

                                  -static-runtime ...... With -static, use static runtime [no] (Windows only)

                                  So, it means it won't work with shared Qt, only with static. I need to think about another way to deal with those libs.

                                  1 Reply Last reply
                                  0
                                  • Cobra91151C Offline
                                    Cobra91151C Offline
                                    Cobra91151
                                    wrote on last edited by
                                    #17

                                    Now I have a solution how to deal with those libs. All Win components are in those locations:

                                    C:\Windows\System32\downlevel
                                    C:\Windows\SysWOW64\downlevel
                                    

                                    I can create some batch script/or static console app to copy those libs to the project directory and add additional step to qmake to execute every time when it needed. So, it will be managed automatically.

                                    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