Question

I have a compiled lib in my /usr/lib/ directory which I would like to know what are all the available functions I can call using this lib. Is there any way to list them?

Was it helpful?

Solution

On linux: nm -D /usr/lib/libmylib.so

The -D is needed for shared libraries. For a C++ library, run this through c++filt to produce more readable names: nm -D /usr/lib/libmylib.so | c++filt

You'll probably be better off trying to find the corresponding headers for the library; you'll need to include the headers anyway if you want to use most of the functions, or rewrite the function prototypes for the methods you're trying to call. The headers might also have documentation on what the function behavior is.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top