Thursday, August 27, 2009

DLLs used by the cygwin built executables

For Windows executable that are built in cygwin to run, the executable depends on some DLLs of cygwin. Hence the executable cannot run on a PC with Windows that sans those DLLs of cygwin.

For such executable to run on PCs with Windows, the dependent DLLs should also be used along with the executable.

Ok, how to find out on what DLLs a executable that built on cygwin depends? Simple, to list out the DLLs use
  • objdump -p executable.exe | grep "DLL Name"

For example, I listed the DLLs used by executable 'cc1.exe'. 'cc1.exe' is generated in cygwin. 'cc1.exe' is a compiler generated using GCC.

D:\GCC>objdump -p cc1.exe | grep "DLL Name"
DLL Name: cygwin1.dll
DLL Name: cygiconv-2.dll
DLL Name: cygintl-8.dll
DLL Name: KERNEL32.dll

No comments: