Module-Definition (.def) Files

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 linker options that can be used instead of module-definition statements, .def files are generally not necessary. You can also use __declspec(dllexport)_ as a way to specify exported functions.

If you are building a .exe file that has no exports, using a .def file will cause your output file to be larger and to load more slowly.