Building DLLs

To build a DLL, use the macros defined for Linking. WIN32.MAK also includes the following macros to simplify linking DLLS:

The following example illustrates how to create the import library for a DLL. The import library is linked with the application that uses this DLL.

mydll.lib: mydll.def mydll.obj
    $(implib) -machine:$(CPU) -def:mydll.def mydll.obj -out:mydll.lib

The following example links the DLL:

mydll.dll : mydll.obj 
    $(link) $(ldebug) $(dlllflags) -base:0x1C000000 mydll.obj \ 
        $(conlibsdll) -out:mydll.dll