Skip to content Skip to sidebar Skip to footer

How Do I Programmatically List A Dll's Dependencies In C++ Or Python?

I'm currently programming a Python interface for a C++ project using Boost Python. The problem is that if a DLL is missing Python gives us a very unhelpful error message: ImportE

Solution 1:

You need to read the Portable Executable Header (PE Header) of the module. This is a structure that describes the imports, exports, re-locations, sections, resources, code, static data, and everything else the binary relies on. While it can be parsed directly, the PE Header structure has a lot of quirks and nuances that aren't obvious. I'd recommend using a library, such as PeLib, to handle everything for you.


Post a Comment for "How Do I Programmatically List A Dll's Dependencies In C++ Or Python?"