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?

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top