VisualAge C++ does not use module definition (.def) files in the
same way that earlier versions did.
To build
a DLL with previous versions of VisualAge C++ for OS/2 3.0 and IBM C and C++ Compilers 3.6, you had to
create a module definition file and supply it to the linker.
In
previous versions of VisualAge for C++ for Windows version 3.5 and IBM C and C++ Compilers 3.6, supplying a module
definition file was optional.
The primary purpose of a .def file was to list the symbols imported or exported by the module being built. You could also specify other options that affected how the linker created the target module. Module definition files are no longer required. Generally, you should have no reason to create one.
However, you may want a .def file as an aid in migrating DLLs
from earlier versions of VisualAge C++, or to extract from an
existing DLL a list of the exported symbols.
These
files may be useful because they show mangled C++ symbol names.
The
names are also decorated on Windows. The ilib
utility cannot determine the calling convention of functions in a
library from by looking at the library file alone, because the
linkage is specified only in the source code or in a .def file.
Therefore, it assumes all exported functions have the default
calling convention, _Optlink.
You can use the ilib command to create a module definition file. Follow the steps listed below:
For example, the following command creates the module definition file winner.def from the DLL winner.dll. If a file named winner.def already exists, it is replaced.
ilib /gd:winner.def winner.dll
![]()
Static and Dynamic
Link Libraries
.def and .exp Files
are Obsolete
Maintaining Libraries
Calling
Conventions
![]()
Build Dynamic Link Libraries
Build Modules That Use DLLs
Export Symbols from a DLL
