| Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date | |
| All threads index page 3 | |
if i use QLibrary class to load libavcodec.so and then they say resolve the symbols. how i can know what are the symbols present in it ? how to use it? anybody plz explain? regards madhan kumar.R The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments contained in it. Contact your Administrator for further information. -- [ signature omitted ]
madhan kumar wrote:
>if i use QLibrary class to load libavcodec.so
>and then they say resolve the symbols.
>
>how i can know what are the symbols present in it ?
>how to use it?
You cannot know what symbols are present in a library. QLibrary does not
provide a way of listing what is available.
You have to know the symbols by some other means. In most cases, you
simply write the name of the symbol in your source code.
For example:
int *data = lib.resolve("varname");
*data = 0;
Or, in the case of a C function:
typedef (*functype)(int, const char *);
functype func = (functype)lib.resolve("functionname");
int i = func(0, "Hello, World");
As far as I remember, you have to use C-style casts to cast a "void*" to a
function pointer.
--
[ signature omitted ]
Attachment:
signature.asc
Description: This is a digitally signed message part.
madhan kumar wrote: > if i use QLibrary class to load libavcodec.so > and then they say resolve the symbols. > > how i can know what are the symbols present in it ? > how to use it? You can use tools like dependancy walker (on Windows) or ldd or objdump (on Unix/Linux). -- [ signature omitted ]