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

Add functionality to QLibrary to resolve symbols from application and currently loaded libraries

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Out of scope
    • P3: Somewhat important
    • Some future release
    • None
    • Other
    • None

    Description

      It would be nice if QLibrary supported resolving symbols from the application and currently loaded libraries, and not only from a particular library to be loaded. This could then be used to perform run-time checks for symbols, and be used to only load a library if the symbol is not already present.

      For example, the following static QLibrary function would be useful, which returns a platform dependent handle if the symbol could be found in the currently loaded libraries, or 0 if the symbol could not be resolved:

      Qt::HANDLE resolve(const char *symbol)

      A use-case for this is on X11 and in the QGLContext::getProcAddress() function, where the GL library is loaded and the glXGetProcAddressARB() function is attempted resolved. However, if the QtOpenGL library already links against some OpenGL library which contains the above symbol, the GL library is still loaded, and a crash may occur at some point due to symbol clashes. If QLibrary supported checking currently loaded symbols, this could easily be avoided, as the GL library could then be loaded only if the glXGetProcAddressARB symbol is not already present.

      Attachments

        Issue Links

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

          Activity

            People

              jasmcdon Jason McDonald (Closed Nokia Identity. Please assign to "macadder" instead) (Inactive)
              sthomass Stian Sandvik Thomassen (closed Nokia identity) (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes