/DLL (Build a DLL)

Home | Overview | How Do I | Linker 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 /EXPORT specification in a LINK command
  3. An EXPORTS statement in a .DEF file

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 Developer Studio; 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 under Type in the New Project Workspace dialog box.