How to build a DLL from the command line in Windows using MSVC

On the command line use:

cl.exe /LD <files-to-compile>

or, if you prefer the more verbose & explicit version:

cl.exe /D_USRDLL /D_WINDLL <files-to-compile> <files-to-link> /link /DLL /OUT:<desired-dll-name>.dll

Leave a Comment