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 build Qt application with dynamic link with 3rd party library.

Static build Qt application with dynamic link with 3rd party library.

Scheduled Pinned Locked Moved Solved General and Desktop
7 Posts 2 Posters 1.1k 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.
  • S Offline
    S Offline
    samdol
    wrote on last edited by samdol
    #1

    Hi,

    If I build an application by static Qt compile, do I have to include 3rd party library statically not dynamically?
    And if I build an application by dynamic Qt compile, do I have to include 3rd party library dynamically not statically?

    1 Reply Last reply
    0
    • VRoninV Offline
      VRoninV Offline
      VRonin
      wrote on last edited by
      #2

      Nope, the link method of a library does nothing for the linking method of other libraries. You are free to mix and match as much as you want.

      The exception is cross dependency:

      • Library A links to Library B dynamically
      • Application C links to library B statically and to library A
      • Bad things happen

      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
      ~Napoleon Bonaparte

      On a crusade to banish setIndexWidget() from the holy land of Qt

      S 1 Reply Last reply
      1
      • VRoninV VRonin

        Nope, the link method of a library does nothing for the linking method of other libraries. You are free to mix and match as much as you want.

        The exception is cross dependency:

        • Library A links to Library B dynamically
        • Application C links to library B statically and to library A
        • Bad things happen
        S Offline
        S Offline
        samdol
        wrote on last edited by
        #3

        @VRonin

        Thank you. Do you mean that:
        App <--S--> libA <--S--> libB (O)
        App <--D--> libA <--D--> libB (O)
        App <--D--> libA <--S--> libB (O)
        App <--S--> libA <--D--> libB (X)

        1 Reply Last reply
        0
        • VRoninV Offline
          VRoninV Offline
          VRonin
          wrote on last edited by VRonin
          #4

          not quite, all your cases are ok

                 ┌ ⇒ D ⇒ libA ⇒ D ⇒ libB
          Ok: App┤
                 └ ⇒ D ⇒ libB
          
                 ┌ ⇒ S ⇒ libA ⇒ D ⇒ libB
          Ok: App┤
                 └ ⇒ D ⇒ libB
          
                 ┌ ⇒ S ⇒ libA ⇒ S ⇒ libB
          Ok: App┤
                 └ ⇒ S ⇒ libB
          
                 ┌ ⇒ D ⇒ libA ⇒ D ⇒ libB
          No: App┤
                 └ ⇒ S ⇒ libB
          

          "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
          ~Napoleon Bonaparte

          On a crusade to banish setIndexWidget() from the holy land of Qt

          S 1 Reply Last reply
          2
          • VRoninV VRonin

            not quite, all your cases are ok

                   ┌ ⇒ D ⇒ libA ⇒ D ⇒ libB
            Ok: App┤
                   └ ⇒ D ⇒ libB
            
                   ┌ ⇒ S ⇒ libA ⇒ D ⇒ libB
            Ok: App┤
                   └ ⇒ D ⇒ libB
            
                   ┌ ⇒ S ⇒ libA ⇒ S ⇒ libB
            Ok: App┤
                   └ ⇒ S ⇒ libB
            
                   ┌ ⇒ D ⇒ libA ⇒ D ⇒ libB
            No: App┤
                   └ ⇒ S ⇒ libB
            
            S Offline
            S Offline
            samdol
            wrote on last edited by samdol
            #5

            @VRonin
            How about following thee cases?

               ┌ ⇒ D ⇒ libA ⇒ S ⇒ libB
            App┤
               └ ⇒ S ⇒ libB
            
               ┌ ⇒ D ⇒ libA ⇒ S ⇒ libB
            App┤
               └ ⇒ D ⇒ libB
            
               ┌ ⇒ S ⇒ libA ⇒ S ⇒ libB
            App┤
               └ ⇒ D ⇒ libB
            
            1 Reply Last reply
            0
            • VRoninV Offline
              VRoninV Offline
              VRonin
              wrote on last edited by
              #6
              1. I think it's ok
              2. No
              3. No

              "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
              ~Napoleon Bonaparte

              On a crusade to banish setIndexWidget() from the holy land of Qt

              S 1 Reply Last reply
              0
              • VRoninV VRonin
                1. I think it's ok
                2. No
                3. No
                S Offline
                S Offline
                samdol
                wrote on last edited by
                #7

                @VRonin

                Thank you for your detail explain. It sounds clearer now.

                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