Build DLL Using Command line Visual C++ cl.exe

Bypass the Visual Studio IDE and build a C++ DLL on the command line using cl.exe. This should generate a small lib (myoutput.lib) that you can link to when you wish to include your dll in a build.

cl -o myoutput.dll myfile1.cpp myfile2.cpp /I D:\required1\include /I D:\required2\include\win32 /link /DLL

For a more in-depth tutorial on building DLLs and then calling them via implict and explicit (GetProcAddress) calls please visit Complete Windows C++ DLL Example


JohnQ said...

You read my mind. This was exactly what I was looking for. Keep up the good work

Anonymous said...

Thank you. This was helpful to me