Can Visual C++ output a static link tree?

Viewed 23

I have a project that links to a fairly large number of both static (.lib) and dynamic libraries (.dll), and many of those libraries include other libraries etc.

We've just found a problem where a particular .lib file is being linked in that has a main() function, which is then being executed when we run the exe instead of our own main() function.

(As an aside, I'm surprised that the linker doesn't complain that there are multiple main functions. I also don't know how it decides which one to use.)

The problem is, I don't actually know how the specific .lib file is being linked in. We're definitely not linking it in directly from our top level exe project, so it must be being linked in by one of the other libs or DLLs, but I have no idea which one and there are too many to check through manually.

If we were dealing with dynamic libraries (Dlls) then we could use Dependency Walker (Depends.exe) to see the dependency tree, but obviously this doesn't work for static libraries. So what I was wondering was whether the Visual C++ linker itself had an option to generate a report showing the static linker tree?

I've tried searching but haven't found anything.

TIA Ben

0 Answers
Related