/DLL (Build a DLL)
The /DLL 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:
__declspec(dllexport) in the source code
An EXPORTS statement in a .def file
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 create a DLL project with an Application Wizard.
Note that if you create your import library in a preliminary step, before creating your .dll, you must pass the same set of object files when building the .dll, as you passed when building the import library.
To set this linker option in the Visual Studio development environment
Open the project's Property Pages dialog box. For details, see Setting Visual C++ Project Properties.
Click the Configuration Properties folder.
Click the General property page.
Modify the Configuration Type property.
To set this linker option programmatically
- See ConfigurationType.