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. Standalone Qt application -- Just to be sure...
Forum Updated to NodeBB v4.3 + New Features

Standalone Qt application -- Just to be sure...

Scheduled Pinned Locked Moved Solved General and Desktop
21 Posts 5 Posters 7.2k 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.
  • mrjjM mrjj
    • I already release the code of my application
      Well it's not really for the end user benefit , it is to comply with the license that allows static linking of
      Qt when not owning a license.

    • hey already have everything set up to build shared versions of Qt, so wouldn't it 'only' require additional CPU time to also build those static versions?

    Yeah, the actual building of it would just be extra hundred hours for all platforms but then after it need to be installed/tested and verified and
    overall it just adds up to many hours, all to to provide easy of use for free.

    But I do agree that downloadable static would be helpful for attracting smaller devs but there is no money in it and hence there is no money for
    such extra effort. So there is more focus on using the hours for development of new version than to supply static of all the combinations they
    currently offer. I have only build static on windows and linux. But you only have to do it once as u can copy the static version.
    If it was no huge, i think the community already had made some precompiled version available.
    But here is also the kicker. We have ppl using 4, 4.8, 5.4 ,5.5 ,5.6, 5.7 and 5.8 so which version should have static?
    All of them would be huuuuge work.

    So the main reason its not already include is the amount of work it is and that Qt is not charity and need income as not to perish.

    A Offline
    A Offline
    agarny
    wrote on last edited by agarny
    #7

    @mrjj From a commercial viewpoint, I can understand Qt's position. Now, from my personal viewpoint, I get the feeling that Qt might not be what I should be using (for that small application of mine). My problem, though, is that I am not sure what other options I have besides Qt if I want to be able to target Windows, Linux and macOS. Argh! :(

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

      Well I agree for a small app, its huge work to release to 3 platforms.
      Also its hard to setup cross compiling in first place so most of us use
      use a virtual machine for each platform. So its 3x build static version and yes
      that is much work when 1 small app. If you make a living with it , it makes more sense
      to setup it all to be able to produce for each platform, but I do see your point with your current project. (aww)

      But I could compile u a 5.7 static version and give you
      and perhaps you can find someone else to produce static version for you.

      Note: I dont know what else you can use. Most other frame targets the mobile marked and not the Desktops.
      Maybe python would do it better for such small app. ( never tested on macOS. but runs the same linux/windows)

      A 1 Reply Last reply
      0
      • mrjjM mrjj

        Well I agree for a small app, its huge work to release to 3 platforms.
        Also its hard to setup cross compiling in first place so most of us use
        use a virtual machine for each platform. So its 3x build static version and yes
        that is much work when 1 small app. If you make a living with it , it makes more sense
        to setup it all to be able to produce for each platform, but I do see your point with your current project. (aww)

        But I could compile u a 5.7 static version and give you
        and perhaps you can find someone else to produce static version for you.

        Note: I dont know what else you can use. Most other frame targets the mobile marked and not the Desktops.
        Maybe python would do it better for such small app. ( never tested on macOS. but runs the same linux/windows)

        A Offline
        A Offline
        agarny
        wrote on last edited by
        #9

        @mrjj Yes, I primarily develop under macOS and have VMs for Windows and Linux, and it's all working fine for my work project. Anyway, thanks for the offer, but I think I am going to leave things as they are for now (i.e. keep releasing my source code on GitHub and leave it to people to build my application themselves, if they want) and keep thinking of a possible alternative to Qt. The problem, though, is that I need my application to sit in the system tray and I also need it to have a GUI so that I can set some colours and a font. All of that can be done relatively easily using Qt, and I am not sure other platforms would make it that easy. Will see... :)

        mrjjM 1 Reply Last reply
        0
        • A agarny

          @mrjj Yes, I primarily develop under macOS and have VMs for Windows and Linux, and it's all working fine for my work project. Anyway, thanks for the offer, but I think I am going to leave things as they are for now (i.e. keep releasing my source code on GitHub and leave it to people to build my application themselves, if they want) and keep thinking of a possible alternative to Qt. The problem, though, is that I need my application to sit in the system tray and I also need it to have a GUI so that I can set some colours and a font. All of that can be done relatively easily using Qt, and I am not sure other platforms would make it that easy. Will see... :)

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

          @agarny
          Ok so u have the setup already. So would not be that huge task to make 3 statics ( when it dont error)
          But its many hours compile time.
          I was wondering if Google Drive allows one huge zip file. It would be possible to share a static build that way.
          But it only works when Qt is installed in same place as pc where build. So its not optimal.

          • I need my application to sit in the system tray

          Well before I landed on Qt i tested other frameworks. And when not
          solely targeting the mobile area, then there were no support of native os things
          like tray icons.

          So if you do find a framework that offer full desktop support and cross compile easy to all targets and easy deployment, please
          do come back and tell the name :)

          A 1 Reply Last reply
          0
          • mrjjM mrjj

            @agarny
            Ok so u have the setup already. So would not be that huge task to make 3 statics ( when it dont error)
            But its many hours compile time.
            I was wondering if Google Drive allows one huge zip file. It would be possible to share a static build that way.
            But it only works when Qt is installed in same place as pc where build. So its not optimal.

            • I need my application to sit in the system tray

            Well before I landed on Qt i tested other frameworks. And when not
            solely targeting the mobile area, then there were no support of native os things
            like tray icons.

            So if you do find a framework that offer full desktop support and cross compile easy to all targets and easy deployment, please
            do come back and tell the name :)

            A Offline
            A Offline
            agarny
            wrote on last edited by
            #11

            @mrjj I just had a look at Lazarus (I used to program using Delphi / C++ Builder many years ago), but I have just seen that they don't support the system tray out of the box on Linux. Also, their IDE is really not great (compared with Qt Creator). So, that's not an option either.

            As you said, I am already all set up with VMs, etc. so I might have a go at building a static version of Qt. I am just hoping that it's only going to be a matter of pressing a button and then wait for hours. Anything else might prove too much hassle for such a program.

            mrjjM 1 Reply Last reply
            0
            • A agarny

              @mrjj I just had a look at Lazarus (I used to program using Delphi / C++ Builder many years ago), but I have just seen that they don't support the system tray out of the box on Linux. Also, their IDE is really not great (compared with Qt Creator). So, that's not an option either.

              As you said, I am already all set up with VMs, etc. so I might have a go at building a static version of Qt. I am just hoping that it's only going to be a matter of pressing a button and then wait for hours. Anything else might prove too much hassle for such a program.

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

              @agarny
              Oh, im old Delphi & Builder user and still Kylix user :)
              Lazarus seems great but not as complete as Qt. It was however lovely to see VLC-(ish) again :)

              Its not so bad to compile a static. First google some good samples and it should be ok.

              I never go around to test this script
              https://gist.github.com/jakoch/ebab7ff300e76257a1bd
              I was told just alter the download path it would do all for me. :)
              But I wanted to learn.

              I think i spend 1 hour reading docs then just compiled it.
              When there is no webkit classes involved its much easier.
              If mac is your pref. Os, then maybe try there first just to see.
              ( i assume its linux like. Sorry never used macOS so it might be ok easy)

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

                Hi,

                To add to @mrjj, "just adding" the static builds doubles the number of provided platforms which includes 3 different compilers only for the Windows version, then you add in Android which is available on the other desktop platforms as well and then iOS. And with all of that we don't take into account architecture.
                All the provided packages are tested by people because not everything can be automatically tested.
                The infrastructure building the package is the same that is already building Qt several times a day to incorporate all the validated submissions.

                That said for the size of the dependencies of your application, Qt 5.8 comes with a new configuration system that will make it easier to tune so you can include only what you need in your build.

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

                A 1 Reply Last reply
                2
                • mrjjM mrjj

                  @agarny
                  Oh, im old Delphi & Builder user and still Kylix user :)
                  Lazarus seems great but not as complete as Qt. It was however lovely to see VLC-(ish) again :)

                  Its not so bad to compile a static. First google some good samples and it should be ok.

                  I never go around to test this script
                  https://gist.github.com/jakoch/ebab7ff300e76257a1bd
                  I was told just alter the download path it would do all for me. :)
                  But I wanted to learn.

                  I think i spend 1 hour reading docs then just compiled it.
                  When there is no webkit classes involved its much easier.
                  If mac is your pref. Os, then maybe try there first just to see.
                  ( i assume its linux like. Sorry never used macOS so it might be ok easy)

                  A Offline
                  A Offline
                  agarny
                  wrote on last edited by
                  #14

                  @mrjj said in Standalone Qt application -- Just to be sure...:

                  Its not so bad to compile a static. First google some good samples and it should be ok.

                  I never go around to test this script
                  https://gist.github.com/jakoch/ebab7ff300e76257a1bd
                  I was told just alter the download path it would do all for me. :)

                  I just had a quick look and it relies on MinGW while I use MSVC 2015. Still, it ought to get me started.

                  @SGaist said in Standalone Qt application -- Just to be sure...:

                  To add to @mrjj, "just adding" the static builds doubles the number of provided platforms which includes 3 different compilers only for the Windows version, then you add in Android which is available on the other desktop platforms as well and then iOS. And with all of that we don't take into account architecture.
                  All the provided packages are tested by people because not everything can be automatically tested.
                  The infrastructure building the package is the same that is already building Qt several times a day to incorporate all the validated submissions.

                  That is all fine, it's just that I mentioned at some point: it doesn't make it easy for people who want to develop and distribute small applications.

                  That said for the size of the dependencies of your application, Qt 5.8 comes with a new configuration system that will make it easier to tune so you can include only what you need in your build.

                  Interesting, would you mind telling us more about this? Maybe a link or something?

                  1 Reply Last reply
                  0
                  • SGaistS SGaist

                    Hi,

                    To add to @mrjj, "just adding" the static builds doubles the number of provided platforms which includes 3 different compilers only for the Windows version, then you add in Android which is available on the other desktop platforms as well and then iOS. And with all of that we don't take into account architecture.
                    All the provided packages are tested by people because not everything can be automatically tested.
                    The infrastructure building the package is the same that is already building Qt several times a day to incorporate all the validated submissions.

                    That said for the size of the dependencies of your application, Qt 5.8 comes with a new configuration system that will make it easier to tune so you can include only what you need in your build.

                    A Offline
                    A Offline
                    agarny
                    wrote on last edited by agarny
                    #15

                    @SGaist Ignore my request, I think I have found what I need: https://blog.qt.io/blog/2016/09/05/qt-5-8-alpha-released/ and http://blog.qt.io/blog/2016/08/18/introducing-the-qt-lite-project-qt-for-any-platform-any-thing-any-size/.

                    kshegunovK 1 Reply Last reply
                    0
                    • A agarny

                      @SGaist Ignore my request, I think I have found what I need: https://blog.qt.io/blog/2016/09/05/qt-5-8-alpha-released/ and http://blog.qt.io/blog/2016/08/18/introducing-the-qt-lite-project-qt-for-any-platform-any-thing-any-size/.

                      kshegunovK Offline
                      kshegunovK Offline
                      kshegunov
                      Moderators
                      wrote on last edited by
                      #16

                      @agarny said in Standalone Qt application -- Just to be sure...:

                      I think I have found what I need

                      Yes, this is it.

                      Read and abide by the Qt Code of Conduct

                      1 Reply Last reply
                      0
                      • A Offline
                        A Offline
                        agarny
                        wrote on last edited by agarny
                        #17

                        FWIW, I have managed to build a static version of Qt 5.6.2 LTS on Windows, Linux and macOS. It was probably eased by the fact that I am already building QtWebKit (for another project, but I don't need it for this one). Anyway, and just in case, here is how I am building Qt 5.6.2 LTS:

                        Prerequisites:

                        • Download and extract Qt 5.6.2 from https://download.qt.io/official_releases/qt/5.6/5.6.2/single/.
                        • Windows: edit [Qt]/qtbase/mkspecs/common/msvc-desktop.conf by replacing:
                        QMAKE_CFLAGS_RELEASE    = -O2 -MD
                        QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -O2 -MD -Zi
                        QMAKE_CFLAGS_DEBUG      = -Zi -MDd
                        

                        with:

                        QMAKE_CFLAGS_RELEASE    = -O2 -MT
                        QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -O2 -MT -Zi
                        QMAKE_CFLAGS_DEBUG      = -Zi -MTd
                        
                        • Linux: make sure that FontConfig is installed (libfontconfig1-dev package on Ubuntu).
                        • macOS: apply the patch at https://code.qt.io/cgit/qt/qtconnectivity.git/commit/?h=5.7.1&id=462323dba4f963844e8c9911da27a0d21e4abf43.

                        Windows:

                        CALL "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64\vcvarsx86_amd64.bat"
                        configure -prefix C:\Qt\Static -opensource -confirm-license -release -static -nomake libs -nomake tools -nomake examples
                        jom
                        jom install
                        

                        Linux:

                        ./configure -prefix /opt/Qt/Static -opensource -confirm-license -release -static -nomake libs -nomake tools -nomake examples -qt-xcb
                        make -j 2
                        sudo make install
                        

                        macOS:

                        ./configure -prefix /Applications/Qt/Static -opensource -confirm-license -release -static -nomake libs -nomake tools -nomake examples
                        make -j 4
                        make install
                        

                        So, now, I am able to statically build my small application, which is perfect. So, thanks all for 'forcing' me into statically building Qt.

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

                          Thank you for the write up. That will surely come in handy.
                          Good luck with the app.

                          1 Reply Last reply
                          1
                          • A agarny

                            Hi,

                            I never had the need to do it until now, but from googling around (e.g. here), I get the feeling that a prerequisite to building a standalone application is furst ti build a static version of Qt. Is that really the case? If so, are there binaries for a static version of Qt that I could download for Windows, Linux and macOS?

                            Cheers, Alan.

                            R Offline
                            R Offline
                            Rondog
                            wrote on last edited by
                            #19

                            @agarny said in Standalone Qt application -- Just to be sure...:

                            Hi,

                            I never had the need to do it until now, but from googling around (e.g. here), I get the feeling that a prerequisite to building a standalone application is furst ti build a static version of Qt. Is that really the case? If so, are there binaries for a static version of Qt that I could download for Windows, Linux and macOS?

                            Cheers, Alan.

                            It depends on what you mean by 'stand alone'. I consider stand alone to mean something that you can run without installing the application or other application dependencies. You don't need a static build to do this. If you want to have one executable file then this is when you need a static build.

                            The application size (sum of size of all required dll's or size of executable) can be large. In your case (45 mb) it sounds like you included the webkit icu dll's. If you build your own version of qt from the sources and exclude webkit you won't have these dependencies and should end up with something around 17 mb.

                            For a stand alone application (using my definition which means it doesn't need to be installed) you should not be using Visual Studio. You will likely need to install the VCRT distributable on every system that you run the program on. The user will end up with an error message when running on a system without the proper VCRT installed. If there is a way to change this behavior in Visual Studio I would like to know otherwise using MinGW is a better option.

                            A 1 Reply Last reply
                            0
                            • R Rondog

                              @agarny said in Standalone Qt application -- Just to be sure...:

                              Hi,

                              I never had the need to do it until now, but from googling around (e.g. here), I get the feeling that a prerequisite to building a standalone application is furst ti build a static version of Qt. Is that really the case? If so, are there binaries for a static version of Qt that I could download for Windows, Linux and macOS?

                              Cheers, Alan.

                              It depends on what you mean by 'stand alone'. I consider stand alone to mean something that you can run without installing the application or other application dependencies. You don't need a static build to do this. If you want to have one executable file then this is when you need a static build.

                              The application size (sum of size of all required dll's or size of executable) can be large. In your case (45 mb) it sounds like you included the webkit icu dll's. If you build your own version of qt from the sources and exclude webkit you won't have these dependencies and should end up with something around 17 mb.

                              For a stand alone application (using my definition which means it doesn't need to be installed) you should not be using Visual Studio. You will likely need to install the VCRT distributable on every system that you run the program on. The user will end up with an error message when running on a system without the proper VCRT installed. If there is a way to change this behavior in Visual Studio I would like to know otherwise using MinGW is a better option.

                              A Offline
                              A Offline
                              agarny
                              wrote on last edited by
                              #20

                              @Rondog I don't actually use QtWebKit in this small application (I have edited my previous comment accordingly). I just meant that because I need to build QtWebKit for another project, I already have some other prerequisites installed (e.g. Perl, Python, Ruby, etc. on Windows).

                              Regarding a standalone application, I indeed meant that I am after one executable file and nothing else (i.e. no shared libraries having to be shipped with my application). This is what I have achieved and my application is ~15.4 MB on Windows, for example.

                              Finally, with regards to Visual Studio, it's actually all fine since Qt was built using -MT and not -MD. As a result, all my application needs are systems DLLs:

                              Dependencies

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

                                Just one thing to take into consideration when using the Visual Studio static runtime. When a new release is done, you're application won't benefit from it. So if there's a security issue found you should provide a new version of your application.

                                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
                                0

                                • Login

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