$ ldd.exe lib/auto/Win32/Win32.xs.dll ntdll.dll => /c/Windows/SYSTEM32/ntdll.dll (0x76db0000) kernel32.dll => /c/Windows/system32/kernel32.dll (0x76c90000) KERNELBASE.dll => /c/Windows/system32/KERNELBASE.dll (0x7fefc9d0000) ??? => ??? (0x64cc0000) #### gendef -a mydll.dll then, using the generated mydll.def: dlltool --kill-at --input-def mydll.def --output-lib libmydll.a