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. Symbol addr to library handle?

Symbol addr to library handle?

Scheduled Pinned Locked Moved Unsolved General and Desktop
shared library
1 Posts 1 Posters 323 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.
  • C Offline
    C Offline
    candy76041820
    wrote on last edited by
    #1

    I need to pass one library handle to another (non-Qt) one, but QLibrary hides the handle. On Windows I can recover it with GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, reinterpret_cast<const TCHAR *>(ptr_to_func_in_lib), &lib_handle), but how can I do this on Linux?

    Assume that I have qLib.setLoadHints(QLibrary::ExportExternalSymbolsHint):

    1. If I should be using dladdr(), is Dl_info::dli_fbase suitable for subsequent dlsym() calls in the other non-Qt library?
    2. Or should I dlopen(qLib.fileName().toLocal8Bit().data()) again, hoping it will return the exact same value (representing the loaded instance of that so)?
    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