[Qt-interest] Regarding DLLs and plugins, QPluginLoader and QLibrary class

Eric Clark eclark at ara.com
Mon Jun 1 22:25:44 CEST 2009


Patric,

When loading DLLs or Shared Objects dynamically (at run-time), you must resolve a pointer to any functions, classes, etc. that you would like access to in the DLL or Shared Object. At compile-time, the compiler does not know the signatures or location of any objects in the dll because it is not linked at compile time. Therefore, you must use the resolve function in the QLibrary class to get a function pointer to the "symbol" (aka an exported function) that you want to use in the library. If you do not know what symbols are exported from the library, you can use a program called Dependency Walker that will show every symbol that is exported from any DLL. Dependency Walker is free of charge, just google Dependency Walker.

Does this help at all?

Eric

From: qt-interest-bounces at trolltech.com [mailto:qt-interest-bounces at trolltech.com] On Behalf Of Patric
Sent: Monday, June 01, 2009 3:17 PM
To: qt-interest at trolltech.com
Subject: [Qt-interest] Regarding DLLs and plugins, QPluginLoader and QLibrary class

Hi all,
I have two simple questions here.
I'm reading the documentation of QPluginLoader http://doc.trolltech.com/4.5/qpluginloader.html#details, and I was wondering what does this means :

QPluginLoader provides direct access to a root component object (instance<http://doc.trolltech.com/4.5/qpluginloader.html#instance>()), instead of forcing you to resolve a C function manually.

And another question, while I was looking at QLibrary documentation http://doc.trolltech.com/4.5/qlibrary.html#load, more specifically http://doc.trolltech.com/4.5/qlibrary.html#resolve,
what do they mean by saying "symbol" ?

and resolve<http://doc.trolltech.com/4.5/qlibrary.html#resolve>() to resolve a symbol in the library


I don't have experience with shared objects and maybe thats the reason I can't get it. I searched the net for a definition but I couldn't found a clear one.

Regards,
Patric


__________ Information from ESET NOD32 Antivirus, version of virus signature database 4098 (20090522) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090601/71ebe210/attachment.html 


More information about the Qt-interest-old mailing list