If you are migrating projects from earlier versions of VisualAge C++ and predecessor products, you should eliminate any module definition files that you previously used during builds. Instead, specify the options that were set in .def files by setting build options or specifying your target in your configuration file.
The major effort of eliminating your old module definition files is likely to be in specifying exports and imports for DLLs. VisualAge C++ provides alternative ways to export and import symbols. Usually the process of building, creating, or using DLLs is simpler than it was before.
Here is a summary of the statements that made up module definition files in VisualAge C++ 3.0 or 3.5, CSet++ 2.0 or 2.1, and IBM C and C++ Compilers 3.6. The statements are listed in alphabetic order and each is followed by the statement syntax, a brief description, and how to convert the statement for the VisualAge C++ build process. If the statement no longer applies to builds, the conversion is specified as "Do not convert". Optional parameters of the statements are enclosed in brackets, [ and ], and alternative items are separated with a vertical line, |.
BASE
| syntax | BASE = address |
|---|---|
| description | Sets preferred load address. |
| conversion | Use build option link(base, address). |
CODE
| syntax | CODE [attributes] |
|---|---|
| description | Sets default attributes for code sections. |
| conversion | Use build option link(code, attributes). |
DATA
| syntax | DATA [attributes] |
|---|---|
| description | Sets default attributes for data sections. |
| conversion | Use build option link(data, attributes). |
DESCRIPTION
| syntax | DESCRIPTION 'string' |
|---|---|
| description | Describes the target module. |
| conversion | Use build option link(versionString, string) |
EXETYPE
| syntax | EXETYPE [ OS2 | WINDOWS | UNKNOWN ] |
|---|---|
| description | Specifies target operating system. |
| conversion | Do not convert. |
EXPORTS
| syntax | EXPORTS [ RESIDENTNAME | NONAME] ] [numwords] [ DECORATED|CONSTANT] ] [numwords] |
|---|---|
| description | Lists symbols exported from DLL, each on a separate line. |
| conversion | Use one of the following techniques:
This last three link options give you less control than link(export, ...) or link (exportList, ...) but are easier to use. You can easily create the file of export specifications for use with link(exportList, fileName) by copying the export descriptions from the lines that follow the EXPORTS keyword in your module definition file into a new file.
|
HEAPSIZE
| syntax | |
|---|---|
| description | Specifies the size of the local heap. |
| conversion |
IMPORTS
| syntax | IMPORTS [internal_name = ] DLLname.entrypoint |
|---|---|
| description | Lists imported functions by name or ordinal, each on a separate line. |
| conversion | Supply an import library with a source directive or use build option link(import, ...). |
LIBRARY
| syntax | |
|---|---|
| description | Names and sets type of target DLL. |
| conversion | Use the directive target [dll] fileName. Optionally also set build option link(base, address). |
NAME
| syntax | |
|---|---|
| description | Names and sets type of target executable file |
| conversion | Use the directive target [exe] fileName. |
OLD
| syntax | OLD '[directory] DLLname' |
|---|---|
| description | Preserves compatibility with old version of a DLL. |
| conversion | Do not convert. |
PHYSICAL
DEVICE
| syntax | PHYSICAL DEVICE fileName [ INITGLOBAL | INITINSTANCE ] [ TERMGLOBAL | TERMINSTANCE ] |
|---|---|
| description | Names and sets type of target physical device driver. |
| conversion | Use the directive target [pdd] fileName. Optionally also set OS/2 build options link(dllInitInstance) and link(dllTermInstance). |
ROBASE
| syntax | ROBASE = address |
|---|---|
| description | Sets start address for read-only segments. |
| conversion | Obsolete, do not convert. |
SEGMENTS
| syntax | SEGMENTS [']segname['] [CLASS 'class'] [attributes] |
|---|---|
| description | Sets attributes for the named segment. |
| conversion | Use build option link(section, name, attributes). |
STACKSIZE
| syntax | STACKSIZE size |
|---|---|
| description | Sets size of the local stack. |
| conversion | Use build option link(stack, reserve, commit). |
STUB
| syntax | |
|---|---|
| description | Adds the named DOS stub. |
| conversion | Use build option link(stub[, fileName]) or link(stub, no). |
VIRTUAL
DEVICE
| syntax | VIRTUAL DEVICE fileName [ INITGLOBAL | INITINSTANCE ] [ TERMGLOBAL | TERMINSTANCE ] |
|---|---|
| description | Names and sets type of target physical device driver. |
| conversion | Use the directive target [vdd] fileName. Optionally also set OS/2 build options link(dllInitInstance) and link(dllTermInstance). |
VERSION
| syntax | VERSION 'file number' |
|---|---|
| description | Adds version string to executable. |
| conversion | Use build option link(version, major[, minor]) |
![]()
.def and .exp Files
are Obsolete
Configuration
Files
Static and Dynamic
Link Libraries
![]()
Build Dynamic Link Libraries
Export Symbols from a DLL
Build Modules That Use DLLs
Add or Change
Source Files
Add or Change
Targets
Set Build Options
Build
![]()
Link Options
Module Definition File
Keywords
