Number version shared library

  • 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?


  • Moderators

    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.

  • in the same folder I have this two version of library:

    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

  • Moderators

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

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

  • Moderators

    it's just a "convention":
    But i think i still don't know what you actually asking for.

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

    you have to write:
    LIBS += -Lpath

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

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.