I am curious about how c/c++ compiler analyse lib files ? I mean say I create a library containing some classes, I am using that library in my main program. How does compiler know what class names are there in that library. Of course that information is present in binary format, I want to use that functionality in my program, to be specific I have a binary lib file and I want to know all classes and properties/functions present in that lib file.
Is it possible ? If compiler can do that why can't some library ?
thanks for any clue
The compiler doesn't do what you are suggesting, but the linker does.
The compiler knows the information it needs from the header files that are included relating to the lib files.
The linker then puts together the declarations you are including and the lib file along with its other object files.
It is probably possible to get the information from the .lib file by decompiling it for example, but this is a lot of work and probably not what you're looking to do.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With