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. Building on a static version of qt
Forum Updated to NodeBB v4.3 + New Features

Building on a static version of qt

Scheduled Pinned Locked Moved General and Desktop
12 Posts 6 Posters 5.7k 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.
  • X Offline
    X Offline
    X9DN
    wrote on last edited by
    #1

    Hello All,

    Recently I've searched all over the internet related to this issue. I've not yet found an answer that works with Qt Creator (Qt SDK Package 1.1.3).

    What I am attempting to do is simple. I would like to statically build my Qt Applications so I can distribute them without shipping all the big dynamic library files like QtCore4.dll and similar. I am pretty sure almost everyone knows how to do this, so please, if you know how (in Qt SDK 1.1.3), can you help me out? Thanks! :)

    From what I know, I think I need to build a separate build of Qt4 (without the creator and such, just the framework alone), and do a command like configure -static, then select in Qt Creator (in the original all-in-one SDK install) to include the static build in options.

    The biggest issue I've encountered so far is that the official Qt Documentations (at the time written probably) are assuming I am using a older version of the Qt SDK and/or Qt Creator with a build of Qt4 combined. I know this is true and can be done around a year ago when I've started using Qt, but nowadays I can't seem to find the corresponding directories in the new all-in-one SDK. i.e. Documentations tells me to run Path-To-Qt-SDK\bin\qtenv.bat, there are no such file as qtenv.bat, there are only qtenv2.bat, qtenv3.bat, and similar, located in various locations throughout the SDK (Simulator, Desktop, Symbian... etc. I assumed everything was Desktop since all my apps are written against windows desktop platforms, but... it just didn't work)

    Any tutorials/docs on this small issue of mine would be helpful. :)

    Thanks!

    1 Reply Last reply
    0
    • L Offline
      L Offline
      lgeyer
      wrote on last edited by
      #2

      [quote author="X9DN" date="1314934967"]Recently I've searched all over the internet related to this issue. I've not yet found an answer that works with Qt Creator (Qt SDK Package 1.1.3).[/quote]

      "Here":http://developer.qt.nokia.com/wiki/How_to_build_a_static_Qt_version_for_Windows_with_gcc you go.

      I would recommend downloading the "source tarball":http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.7.4.zip or fetching the sources directly from "gitorious":http://qt.gitorious.org/qt. qtenv2.bat is at Desktop/Qt/4.7.4/mingw/bin.

      [quote author="X9DN" date="1314934967"]What I am attempting to do is simple. I would like to statically build my Qt Applications so I can distribute them without shipping all the big dynamic library files like QtCore4.dll and similar.[/quote]

      You will most probably need a commercial Qt license then.

      1 Reply Last reply
      0
      • X Offline
        X Offline
        X9DN
        wrote on last edited by
        #3

        http://developer.qt.nokia.com/wiki/How_to_build_a_static_Qt_version_for_Windows_with_gcc

        LOL that's exactly where I've looked at already- will try agian

        and no - I am not building commercial apps, I build them for my school's programming club and some other friends as well. No profit is being made.

        1 Reply Last reply
        0
        • L Offline
          L Offline
          lgeyer
          wrote on last edited by
          #4

          I am not a lawyer.

          1 Reply Last reply
          0
          • G Offline
            G Offline
            giesbert
            wrote on last edited by
            #5

            I thought, if you want to link statically, open source also be an option?

            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
            0
            • R Offline
              R Offline
              Rahul Das
              wrote on last edited by
              #6

              bq. It doesn’t matter how your application is licensed or if it is commercial or not. You link Qt statically – you will need a commercial Qt license.

              Nice slides :) But,It is all about Commercial and LGPL.. and not about GPL.


              Declaration of (Platform) independence.

              1 Reply Last reply
              0
              • L Offline
                L Offline
                lgeyer
                wrote on last edited by
                #7

                [quote author="Gerolf" date="1314954659"]I thought, if you want to link statically, open source also be an option? [/quote]

                You are right. The paragraph was quite misleading. I removed it.

                1 Reply Last reply
                0
                • X Offline
                  X Offline
                  X9DN
                  wrote on last edited by
                  #8

                  so... you can't link statically under LGPL...?! Because then every app I write is at least 100 MB+ in size... which the school does not allow because their shared network drive is so small...

                  1 Reply Last reply
                  0
                  • sierdzioS Offline
                    sierdzioS Offline
                    sierdzio
                    Moderators
                    wrote on last edited by
                    #9

                    [quote author="X9DN" date="1314974704"]so... you can't link statically under LGPL...?! Because then every app I write is at least 100 MB+ in size... which the school does not allow because their shared network drive is so small...[/quote]

                    You're probably using debud DLLs? Compile release, and use release DLLS, they are 5MB (at least used to be, it's been a while since I've been on Windows).

                    (Z(:^

                    1 Reply Last reply
                    0
                    • G Offline
                      G Offline
                      giesbert
                      wrote on last edited by
                      #10

                      Why is every app 100+ MB?
                      You need at least QtGui and QtCore, together about 13 MB, and you only need them once...
                      Did you perhaps use the debug versions?

                      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
                      0
                      • A Offline
                        A Offline
                        asong1
                        wrote on last edited by
                        #11

                        Just would like to know how you managed to combine them together. I have been trying for hours yet no luck. A small tutorial would be nice thanks!

                        1 Reply Last reply
                        0
                        • R Offline
                          R Offline
                          Rahul Das
                          wrote on last edited by
                          #12

                          <Qt Root folder>\Desktop\Qt\4.7.3\mingw\bin

                          Here you can find, The dlls you require. When you take debug version, for example , QtCored4.dll its about 31mb. But what exactly you need is QtCore4.dll and is about 2.5 mb.

                          same case for other libraries.

                          Anyway, you are building statically, and you must be building the debug version.


                          Declaration of (Platform) independence.

                          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