PDA

View Full Version : How to View Classes and Functions inside .so library file



KAMATCHI
19th October 2011, 05:57
I have created a library function libtest.so
I need to know the class and method names inside the library.
Is there any method in QLibrary to view class and method names .

ChrisW67
19th October 2011, 06:24
You have created this library but you cannot read the source code or headers to know what is in the library? :confused:

QLibrary requires you to know the names you want to use.

On Linux you can us the "nm --demangle" command on dynamic libraries that have not been stripped.

KAMATCHI
19th October 2011, 06:30
Thanks for ur reply
Through linux Commands i can view the class names.
But i want it through QT ( QLibrary/QPluginLoader)

ChrisW67
19th October 2011, 06:58
Read the source of the library. Qt hands resolution of names in dynamic libraries to the underlying operating system, dlopen() and dlsym() on Linux, and reports success or failure. QLibrary has no list of symbols to give you.

AFAIK, there is no glibc function that lists all symbols. You'll have to write your own, or use one written by someone else (look for libelf library) or perhaps the Binary File Descriptor library from GNU binutils.