Share via


EXPORTS

OverviewFAQDetails

Syntax

EXPORTS*****definitions*

This statement makes one or more definitions available as exports to other programs.

EXPORTS marks the beginning of a list of export definitions. Each definition must be on a separate line. The EXPORTS keyword can be on the same line as the first definition or on a preceding line. The .DEF file can contain one or more EXPORTS statements.

The syntax for an export definition is:

entryname[=internalname] [@ordinal[NONAME]] [DATA] [PRIVATE]

The optional keyword PRIVATE prevents entryname from being placed in the import library generated by LINK. It has no effect on the export in the image also generated by LINK.

There are three methods for exporting a definition, 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

All three methods can be used in the same program. When LINK builds a program that contains exports, it also creates an import library, unless an .EXP file is used in the build.