.def and .exp Files are Obsolete (OS/2, Windows)

You do not need module definition (.def) files to create dynamic link libraries or import libraries. Do not supply module definition files as a source files for builds.

The make2cfg utility can produce a configuration file that refers to a .def file as a result of converting makefile that creates a DLL into configuration file. When this happens you must change the way you export symbols from your DLL.

In VisualAge C++ for OS/2 3.0 and IBM C and C++ Compilers 3.6, building a DLL was a multi-step process. One of the steps was to create a .def file. At a later step, you supplied this file, as well as your source or object files, to tools that used them to create a DLL or an import library.

On Windows, you no longer need .exp files.

In VisualAge for C++ for Windows version 3.5 and IBM C and C++ Compilers 3.6, building a DLL was a multi-step process. You could optionally supply a .def file, and you needed a .exp file to complete the link step.

Now, you define your build with a configuration file and you set the type and name of the file that is being built when you specify the target of the build. Most of the statements you previously entered in .def files have been replaced by build options.

The most striking difference between the old way and new way of building a DLL is how you export symbols from the DLL. You can export symbols with build options. As before, you can also explicitly export symbols by using pragmas and keywords in the source.

VisualAge C++ provides additional build options for C++ code that you can use to export all external symbols, all external symbols in a namespace, or all external symbols that begin with a specified prefix. If you use one of these build options, you do not have to export symbols individually.



Static and Dynamic Libraries
Configuration Files


Convert Module Definition Files
Build Dynamic Link Libraries
Export Symbols from a DLL
Create Module Definition Files
Create an Import Library and Export Object


Build Options
Module Definition File Keywords