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. Statically linking the openssl libraries?
Forum Updated to NodeBB v4.3 + New Features

Statically linking the openssl libraries?

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

    maybe i stated this a little wrong.

    Say i wanted my QT application to statically link to SSL. When setting up QT do i use the following

    configure -openssl-linked .......

    now everytime when i compile a QT application will it automatically statically link this library into my qt application when im not needing it?! if so how do i get around this :(?

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

      I have not worked with openssl yet. Therefore, I am not sure how you have to link your applications. However, I assume that it is a separate library similar to the other different Qt libs (e.g. Network, Gui and so on). So I do not see a reason that all is lumped together all the time. That makes no sense.
      I think, I have to admit I am not complete sure, but the linker should take nowadays only the objects out of a required lib which are really referenced. Also this would not prevent that openssl objects are part of the executable when not required.
      20 years ago linkers just bound the whole lib into your executable, which was not optimal with a 640k RAM limit.
      If you really want to be sure, you could separate the openssl lib from the others. However, I would not recommend this in general, because makes things complicated.
      However, for a test you could do. Link a static application when the openssl lib is also in the directory with the other libs. Note the size of your exe and do the same when the lib is not pressent. This might convince you.

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

      1 Reply Last reply
      0
      • R Offline
        R Offline
        rich
        wrote on last edited by
        #5

        [quote author="maybnxtseasn" date="1332430324"]maybe i stated this a little wrong.

        Say i wanted my QT application to statically link to SSL. When setting up QT do i use the following

        configure -openssl-linked .......

        now everytime when i compile a QT application will it automatically statically link this library into my qt application when im not needing it?! if so how do i get around this :(? [/quote]

        Using -openssl-linked does not make openssl statically linked. What it does is switch from using dlopen() and dlsym() to load and call the openssl library and instead uses the normal dynamic linker. Using this option means that issues such as binary compatibility of the openssl library need to be handled or avoided, whereas the default of using dlopen() allows Qt to work around binary compatibility issues in openssl.

        It is possible that you could combine static linking with -openssl-linked though that's not a configuration that is tested by CI etc. If you did so then it would mean that your QtNetwork library would have a statically linked copy of openssl. Doing this is a very bad idea however, since it would make upgrading openssl much harder should any security issues in the library be found.

        1 Reply Last reply
        0
        • M Offline
          M Offline
          maybnxtseasn
          wrote on last edited by
          #6

          Ive compiled QT and run the following in command prompt

          configure -platform win32-msvc2010 -openssl-linked
          nmake

          QT compiles fines but when i go into my project and add a web browser to a simple QWindow and compile, it seems as if QT has not embedded openssl within the binary statically. Is there a step im missing?

          1 Reply Last reply
          0
          • M Offline
            M Offline
            mlong
            wrote on last edited by
            #7

            You've already asked this question "here.":/forums/viewthread/15677/ and received quite a bit of feedback. Please don't double post.

            Software Engineer
            My views and opinions do not necessarily reflect those of anyone -- living or dead, real or fictional -- in this universe or any other similar multiverse node. Void where prohibited. Your mileage may vary. Caveat emptor.

            1 Reply Last reply
            0
            • P Offline
              P Offline
              pumper
              wrote on last edited by
              #8

              Have you tride :
              @
              CONFIG += static
              @
              in your pro file

              1 Reply Last reply
              0
              • P Offline
                P Offline
                pumper
                wrote on last edited by
                #9

                Have you tried :
                @
                CONFIG += static
                @
                in your pro file

                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  andre
                  wrote on last edited by
                  #10

                  I have merged two very similar topics by the same topic starter. Please don't duplicate your posts.

                  1 Reply Last reply
                  0
                  • P Offline
                    P Offline
                    pumper
                    wrote on last edited by
                    #11

                    sorry It was my fault

                    1 Reply Last reply
                    0
                    • F Offline
                      F Offline
                      francomartins
                      wrote on last edited by
                      #12

                      [quote author="mlong" date="1332872630"]You've already asked this question "here.":/forums/viewthread/15677/ and received quite a bit of feedback. Please don't double post.
                      [/quote]

                      this link goes to this same page

                      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