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

Could not import with QLibrary::load(), required extra g++ link flags

    XMLWordPrintable

    Details

    • Type: Suggestion
    • Status: Reported
    • Priority: P3: Somewhat important
    • Resolution: Unresolved
    • Affects Version/s: 5.15.0
    • Fix Version/s: None
    • Labels:
      None
    • Platform/s:
      Linux/X11

      Description

      I followed all of the documentation page instructions for QLibrary and its load() method.

      However all attempts to load() failed. After debugging the Qt library code, i found that it was not resolving some symbols that WERE in the the main application.

      In order for the QLibrary::load() to work, I had to link the main application on Linux, Fedora version 32, 64-bit, g++ with:

      unix:

      { QMAKE_LFLAGS +=  "-Wl,--export-dynamic"}

      Once I did that, QLibrary::load() worked and my plugin worked. This is my first run-time plug-in application.

      I looked for something I missed in the documentation and did not find  any.

      I would suggest that the documentation ADD the above information to the QLibrary:load() documentation. Or document any generic way to specify that need.

      I have NO idea if this effects other build platforms. I would suspect it effects Android.

       

        Attachments

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

          Activity

            People

            Assignee:
            qtbuildsystem Qt Build System Team
            Reporter:
            dougroyer Doug Royer
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes