Share via


/DLL   (Build a DLL)

OverviewHow Do ILinker Options

This option builds a DLL as the main output file. A DLL usually contains exports that can be used by another program. There are three methods for specifying exports, listed in recommended order of use:

  1. The __declspec(dllexport) keyword in the source code

  2. An EXPORTS statement in a .DEF file

  3. An /EXPORT specification in a LINK command

A program can use more than one method.

Another way to build a DLL is with the LIBRARY module-definition statement. The /BASE and /DLL options together are equivalent to the LIBRARY statement.

Do not specify this option within the development environment; this option is for use only on the command line. This option is set when you select either MFC AppWizard (DLL) or Dynamic-Link Library on the Projects tab of the New dialog box.