Skip to content

Instantly share code, notes, and snippets.

@gdianaty
Created December 19, 2019 21:00
Show Gist options
  • Save gdianaty/09e520ee3106fc28fbff2cde08bfe49a to your computer and use it in GitHub Desktop.
Save gdianaty/09e520ee3106fc28fbff2cde08bfe49a to your computer and use it in GitHub Desktop.
Generate .lib files from every DLL in the same directory as this batch file.
@echo off
:: Authored by a very lazy Graham Dianaty, 2019
:: Move recursively thru all files in same directory and generate lib files for them using black magic.
:: Note: %%~nf removes the extension from a file.
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools\VsDevCmd.bat"
cls
for /R %%f in (*.dll) do (
echo [symbolgen.bat] Dumping %%f...
dumpbin /exports "%%~nf.dll" > "%%~nf.def"
echo [symbolgen.bat] Compiling %%~nf symbols for win32
lib /def:"%%~nf.def" /out:"%%~nf.lib" /machine:x86 >> "%%~nf.compilelog.txt"
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment