开发者

how to find classes present in a c++ library (.lib)?

开发者 https://www.devze.com 2023-01-12 07:47 出处:网络
what tool can I use to find classes present in a C++ static library (.lib) ? This information is 开发者_Go百科for building a library in one solution and use it in another solution by giving lib as inp

what tool can I use to find classes present in a C++ static library (.lib) ? This information is 开发者_Go百科for building a library in one solution and use it in another solution by giving lib as input to linker. As the lib can come from 3rd parties, its difficult to find what services it is offering.


Usually from the documentation and headers. If you don't have that, you could use dumpbin -exports or dumpbin -symbols on it to get a list of exported functions (mostly, -symbols for static librarys, -exports for a link library for a DLL).

If the code was written in (Microsoft) C++, and the public names are mangled, that can tell you quite a bit (return types, parameter types). If they're basically C functions (either from a C compiler, or a C++ compiler but marked with extern "C"), the names won't be mangled, so it won't be able to tell you nearly as much (just names, nothing about the type or even number of parameters).


If it's a third party library you usually need at least header files (usually .h) that will contain class declarations with its corresponding members. You will use that header file to compile your code and then link with the compiled library.

There is no standard way of getting that information from the compiled binary.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号