Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-108886

QLibrary fails to load libraries in Ubuntu

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 6.4.1
    • Core: Plugins
    • None
    • Linux/X11

    Description

      In the attached example there are 2 projects:

      • engine - generates a dummy "engine" library:
        engine.dll - for Windows
        libengine.so - for Linux
      • libtest - generates an executable which loads the library via QLibrary.

      The library name is "engine", under windows QLibrary loades the library without errors.
      In Ubuntu it fails to find the library. It loads the library only if correct path with real file name is specified "./libengine.so"
      "Cannot load library engine: (engine: cannot open shared object file: No such file or directory)"

      The documentation states that it should be enough to specify the library name (without the "./lib* prefix and the file extension):
      "If the file path is not absolute then QLibrary modifies the search order to try the system-specific prefixes and suffixes first, followed by the file path specified.
      This makes it possible to specify shared libraries that are only identified by their basename (i.e. without their suffix)."

      It is expected that "engine" should work on any platform.

      To reproduce:
      1) Build both projects.
      2) copy the *.so and *.dll to the build directory of libtest project.
      3) Run libtest project.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            thiago Thiago Macieira
            alexey89 alexey89
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes