Def Of Etiquette

A module-definition or DEF file (*.def) is a text file containing one or more module statements that describe various attributes of a DLL. If you are not using the __declspec(dllexport) keyword to export the DLL's functions, the DLL requires a DEF file.

Def Of Etiquette 1

Module-definition (.def) files provide the linker with information about exports, attributes, and other information about the program to be linked. A .def file is most useful when building a DLL. Because there are MSVC Linker Options that can be used instead of module-definition statements, .def files are generally not necessary.

Def Of Etiquette 2

The /DEF linker option passes a module-definition file (.def) to the linker. Only one .def file can be specified to LINK. For details about .def files, see Module-definition files. To specify a .def file from within the development environment, add it to the project along with your other source files and then specify the file in the project's Property Pages dialog.

Def Of Etiquette 3

A module-definition (.def) file is a text file containing one or more module statements that describe various attributes of a DLL. If you do not use __declspec(dllimport) or __declspec(dllexport) to export a DLL's functions, the DLL requires a .def file. You can use .def files to import into an application or to export from a DLL.

Def Of Etiquette 4

Create a module definition (.def) file and use the .def file when building the DLL. Use this approach if you want to export functions from your DLL by ordinal rather than by name. Use the keyword __declspec(dllexport) in the function's definition. When exporting functions with either method, make sure to use the __stdcall calling convention.

The following syntax rules apply to all statements in a .def file. Other rules that apply to specific statements are described with each statement. Statements, attribute keywords, and user-specified identifiers are case sensitive. Long file names containing spaces or semicolons (;) must be enclosed in quotation marks (").

Def Of Etiquette 6