Linking Legacy (16-bit) DP4 C Programs

For each compiler and memory model supported we supply a file called dp4link.bat. This can link your application for a variety of operating systems or versions. The options available depend on the compiler and memory model selected. The syntax of the DP4LINK batch file is:

DP4LINK [program type] progname [/m]

If program type is not specified dp4link will choose a default based on the current operating system. The possible program types are as follows:

Type Meaning
/c Generates DOS small model convertible programs. Requires the root module MCROOT2.OBJ or HCROOT2.OBJ
/7

Generates OS/2 small model programs linked with the root module MCROOT7.OBJ or HCROOT7.OBJ

/8

Generates Windows small model programs linked with the root module MCROOT8.OBJ or HCROOT8.OBJ

/10

Generates OS/2 Presentation Manager small model programs linked with the root module MCROOTP.OBJ or HCROOTP.OBJ

/r Generates DOS (real mode) programs (this is the default)
/p Generates OS/2 programs
/pm Generates OS/2 Presentation Manager programs
/w Generates Windows programs

The /c,/7,/8,/10 options are only available when linking small model programs.

You can find out exactly which options are available for your chosen compiler and memory model by running dp4link -help

DOS programs generated with the option /c may be converted to run under other operating systems with the conversion utilities described in Conversion Utilities.

In addition to the options above, the option /m may be given to generate a map file.

Additional information on linking 16 bit Windows programs can be found here.

If a Metaware version of DP4LINK detects that it is being run on FlexOS it automatically links a FlexOS program. You can use /o as a program type to tell DP4LINK to link to TRM5.OVR in place of TRM5.286. This is recommended.

When linking your program DP4LINK will look for a file named progname.lnk. If this exists it is assumed to contain input for the linker, normally a list of filenames separated with spaces. If DP4LINK cannot find such a file it assumes your program consists of a single object module progname.obj and tries to link that.

Other Batch Files

As well as DP4LINK, other similar batch files are supplied for linking specific program types: