What is the equivalent of Linux's ldd
on Windows?
Here is Dependency Walker.
The dumpbin
command can be useful for many things, although in this case dependency walker is probably a little more verbose.
dumpbin /dependents some.dll
Example output:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Team Tools\Static Analysis Tools>dumpbin /dependents StanPolicy.dll
Dump of file StanPolicy.dll
File Type: DLL
Image has the following dependencies:
mscoree.dll
Summary
2000 .reloc 2000 .rsrc 1E000 .text
Here is Dependency Walker.
or the GNU tool :
i586-mingw32msvc-objdump -p *.exe | grep 'DLL Name:'
ldd
does. –
Capybara If you're using wine
and not real Windows, you can use WINEDEBUG=+loaddll wine <program>
.
GdiplusStartup
, and GDI+ worked without problems in Wine, while on Windows it didn't. I only noticed this mistake after having debugged the program in Wine, trying next to run it in Windows. –
Rawls Newer versions of Git on Windows come packaged with something called Git BASH, which emulates many useful Unix commands including ldd.
It appears that it reports only libraries that can be found. So you can use this to get an overview of where the used libraries are located, but not which are missing.
There is now an ldd
in Cygwin. If you have a very old Cygwin version, you will have to use cygcheck
.
I guess the Windows Developer way to do this is to use dumpbin /dependents source.exe
. If you have Visual Studio installed you can find it here: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\dumpbin.exe
.
For Windows 10 you can use Dependencies - An open-source modern Dependency Walker
For windows 10, with visual studio 2017, I go in the search bar of windows and type:
"developer Command Prompt for VS 2017" ( a special cmd.exe for Visual studio developer)
This allows to get access to DUMPBIN that should be used with the /IMPORTS tag. For example, in the correct directory:
DUMPBIN /IMPORTS yourfile.exe (others extension may work too)
For me, this list the DLL and the functions used.
Alternatively, you can use the tag \ALL that is much more verbose.
see the microsoft explanation of DUMPBIN:
https://learn.microsoft.com/en-us/cpp/build/reference/imports-dumpbin?view=vs-2019
Example ( with only a part) of the content sended back by the command
dumpbin /imports *.dll | find /i ".dll"
–
Flicker On Windows I use the cmder as terminal for most things (and not powershell/pwsh). For cmder you can simply type "ldd my_executable.exe" and you will see the expected output.
Link to download cmder: https://cmder.net/
ldd
bundled with git bash, which was already mentioned in previous answers. –
Vituperation © 2022 - 2024 — McMap. All rights reserved.