Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Qt Academy Launch in California!

    Build Qt without all the widgets I don't need

    General and Desktop
    5
    8
    2798
    Loading More Posts
    • 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.
    • D
      Donner last edited by

      Hi,

      I am using Qt for a really small project (just one window, a few push buttons and some other minor stuff). Still, I need the Qt-DLLs and ship them with my executable file (at least on Windows).

      Now, my executable only is about 200 KB big, but the Qt DLLs (Core and GUI, bult in release mode) take almost 10 MB which is quite a lot since I don't need most of the stuff in there.

      Is there a way of building Qt only with what I actually need and use in my application?

      I know the wiki page http://qt-project.org/doc/qt-4.8/configure-options.html, but is there a way to optimize the size further?

      Thank you in advance,
      D.

      1 Reply Last reply Reply Quote 0
      • D
        dangelog last edited by

        Have you tried to use static linking and LTO?

        Software Engineer
        KDAB (UK) Ltd., a KDAB Group company

        1 Reply Last reply Reply Quote 0
        • G
          giesbert last edited by

          If you use static linking, take care of the licence stuff.
          LGPL does not allow static linkage. Commercial license allows it. IIRC, GPL also allows it.

          Nokia Certified Qt Specialist.
          Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

          1 Reply Last reply Reply Quote 0
          • A
            andre last edited by

            Yes, there are more options for optimization. There is a header file somewhere that has loads of defines that enable you to switch features on and off very specifically. I'll dig a bit to find it.

            Edit:
            Found it. You're looking to modify <qtdir>\src\corelib\global\qfeatures.h

            1 Reply Last reply Reply Quote 0
            • A
              Asperamanca last edited by

              You can also define your own feature set using the qconfig tool. You can find it (as a project with sources) under "tools".

              Consider that you can also remove a lot of features using the command line options of "configure", when building Qt. Call configure -h to get a full list of options.

              1 Reply Last reply Reply Quote 0
              • D
                Donner last edited by

                [quote author="peppe" date="1331177864"]Have you tried to use static linking and LTO?[/quote]
                Hey, thanks for your reply. Unfortunately because I can't afford the commercial license, static linking is no option. But what does LTO stand for?

                [quote author="Andre" date="1331177864"]Yes, there are more options for optimization. There is a header file somewhere that has loads of defines that enable you to switch features on and off very specifically. I’ll dig a bit to find it.
                Edit: Found it. You’re looking to modify <qtdir>\src\corelib\global\qfeatures.h
                [/quote]I'll have a look into that file, thanks a lot :)

                1 Reply Last reply Reply Quote 0
                • D
                  Donner last edited by

                  [quote author="Asperamanca" date="1331200410"]You can also define your own feature set using the qconfig tool. You can find it (as a project with sources) under "tools".

                  Consider that you can also remove a lot of features using the command line options of "configure", when building Qt. Call configure -h to get a full list of options.[/quote]qconfig seems to be very promising, didn't know that tool. Thank you!

                  1 Reply Last reply Reply Quote 0
                  • A
                    Asperamanca last edited by

                    There's also an article explaining the use of qconfig:

                    http://doc.qt.nokia.com/4.7-snapshot/fine-tuning-features.html

                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post