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. Number version shared library
Qt 6.11 is out! See what's new in the release blog

Number version shared library

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

    Hi everyone,
    I've developed my custom library from link to myApplication.
    In order to link, in file .pro I've written:
    LIBS += -Lpath -lmylibrary

    and that's all very well, but if I've more version of mylibrary, how can I do to force to use a specific version of mylibrary?

    Thanks!
    Stefano

    1 Reply Last reply
    0
    • raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      what do you mean?
      By specifying the -L parameter you already tell the compiler/linker where to look for the library.

      And it's also not possible that 2 libraries have the same filename in the same folder, thus either your libraries are already in different paths or named differently.

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      0
      • S Offline
        S Offline
        ste1786
        wrote on last edited by
        #3

        in the same folder I have this two version of library:
        mylibrary.so.1.0.0
        mylibrary.so.1.1.0

        With the instruction under,in my app, the compiler/linker link the last *.so.1.1.0 but if I want to force myApp to use the previous version?
        LIBS += -Lpath -lmylibrary

        1 Reply Last reply
        0
        • raven-worxR Offline
          raven-worxR Offline
          raven-worx
          Moderators
          wrote on last edited by
          #4

          why not just putting them into a subfolder named by version?

          --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
          If you have a question please use the forum so others can benefit from the solution in the future

          1 Reply Last reply
          0
          • S Offline
            S Offline
            ste1786
            wrote on last edited by
            #5

            well ok...it's a possible solution, but I wanted to understand the meaning of sym links that I have when I compile mylibrary.

            1 Reply Last reply
            0
            • raven-worxR Offline
              raven-worxR Offline
              raven-worx
              Moderators
              wrote on last edited by
              #6

              it's just a "convention":http://www.faqs.org/docs/Linux-HOWTO/Program-Library-HOWTO.html#AEN46.
              But i think i still don't know what you actually asking for.

              --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
              If you have a question please use the forum so others can benefit from the solution in the future

              1 Reply Last reply
              0
              • S Offline
                S Offline
                ste1786
                wrote on last edited by
                #7

                Solved:
                in your .pro file instead of writing:
                LIBS += -Lpath -lmylibrary

                you have to write:
                LIBS += -Lpath -l:mylibrary.so.1.0

                in this way force the link to use that specific library version.

                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