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. Static library linking
QtWS25 Last Chance

Static library linking

Scheduled Pinned Locked Moved General and Desktop
12 Posts 4 Posters 7.3k 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.
  • T Offline
    T Offline
    TheDestroyer
    wrote on last edited by
    #3

    How can I know that?

    1 Reply Last reply
    0
    • T Offline
      T Offline
      TheDestroyer
      wrote on last edited by
      #4

      I copied gsl libraries beside the executable, and I got an error with QtCored4.dll... which means, even Qt libraries are not statically linking!

      Any ideas?

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

        Have you made a complete build from the qt source package with static flag for configure?
        The qt distribution does not contain static libraries.

        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
        • T Offline
          T Offline
          TheDestroyer
          wrote on last edited by
          #6

          I'm using QtCreator. Doesn't it do that automatically if I set the correct flags in qmake?

          Does this mean that I always have to have QtCored.dll and some other dlls for Qt with my programs???

          1 Reply Last reply
          0
          • K Offline
            K Offline
            koahnig
            wrote on last edited by
            #7

            No, QtCreator does not generate static Qt libraries automatically.

            You have to compile Qt with static in configure as suggested by Gerolf.

            Even without the static libraries you do not need to have Qt dlls with your programs. Typically it is assumed that someone receiving your program has already Qt dlls installed.

            Vote the answer(s) that helped you to solve your issue(s)

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

              If you install QtCreator, you have no libraries (it#s only the IDE)
              If you install the SDK, you have the dlls you can use but not libraries for static linking. If you need static linking, please use the search on the forum and the wiki, there were many topics on that one. You have to build Qt for static linkage from the sources. Sorry, there is no other way for statically linked executables.

              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
              • T Offline
                T Offline
                TheDestroyer
                wrote on last edited by
                #9

                Thank you. I'll see what I can do about it. :-)

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

                  Be aware of the licensing implications, when linking statically to Qt!

                  http://www.catb.org/~esr/faqs/smart-questions.html

                  1 Reply Last reply
                  0
                  • T Offline
                    T Offline
                    TheDestroyer
                    wrote on last edited by
                    #11

                    Could you please tell me about them? I'm using my programs for the university to create physics simulations!!! I'm not gonna sell them!!

                    1 Reply Last reply
                    0
                    • G Offline
                      G Offline
                      goetz
                      wrote on last edited by
                      #12

                      Have a look at the tag search, please:

                      • http://developer.qt.nokia.com/search/tag/license
                      • http://developer.qt.nokia.com/search/tag/licensing

                      The base line (I'm not a lawyer!) is, that you most probably have to GPL your code if you do static linking (except in case you use commercial license, of course).

                      http://www.catb.org/~esr/faqs/smart-questions.html

                      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