简体   繁体   English

查找LIB的已加载DLL

[英]Find loaded DLL for LIB

In VS 2005, I can see paths of the libs linker is searching for by explicitly setting the option in IDE. 在VS 2005中,我可以通过在IDE中显式设置选项来查看libs链接程序的路径。 How to find the where the corresponding dll is loaded from ? 如何找到从中加载相应dll位置?

1>Searching libraries
1>    Searching C:\Program Files (x86)\Microsoft Visual Studio 8\VC\lib\msvcrtd.lib:
1>      Found _memcpy
1>        Referenced in deflate.obj
1>        Referenced in gzio.obj
1>        Referenced in infback.obj
1>        Referenced in inflate.obj
1>        Loaded msvcrtd.lib(MSVCR80D.dll)

In the above case, where is MSVCR80D.dll is coming from ? 在上述情况下, MSVCR80D.dll是从哪里来的? I searched in the VC directory for the dll and more than 10 results popped up. 我在VC目录中搜索dll,并弹出了10多个结果。 Is there any easy way to find which one is exactly loaded ? 有什么简单的方法可以找到确切加载的一个?

The DLLs are actually loaded at runtime, not at link time. 这些DLL实际上是在运行时而不是在链接时加载的。 Actually, native DLLs don't even have to be present in the machine to do the link. 实际上,本地DLL甚至不必存在于计算机中即可进行链接。

You can see that information running your program in the debugger (usually F5) and the opening the "Modules window" from the "Debug" submenu, IIRC. 您可以看到该信息在调试器(通常为F5)中运行程序,并从“调试”子菜单IIRC中打开“模块窗口”。

Also, you can analyze the executable and try deducing which DLL will be loaded. 另外,您可以分析可执行文件,然后尝试推断将加载哪个DLL。 The best tool for that is, no doubt, the Dependency Walker . 无疑,最好的工具是Dependency Walker It can analyze DLLs too (cool) but it may have troubles with managed DLLs. 它也可以分析DLL(很酷),但可能会对托管DLL造成麻烦。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM