LINK /PAC and /F Options Are Not Supported by Basic Compiler (31881)



The information in this article applies to:

  • Microsoft QuickBASIC 4.0, when used with:
    • the operating system: MS-DOS
  • Microsoft QuickBASIC 4.0b, when used with:
    • the operating system: MS-DOS
  • Microsoft QuickBASIC 4.5, when used with:
    • the operating system: MS-DOS
  • Microsoft BASIC Compiler for MS-DOS and OS/2 6.0
  • Microsoft BASIC Compiler for MS-DOS and OS/2 6.0b
  • Microsoft Basic Professional Development System (PDS) for MS-DOS and MS OS/2 7.0

This article was previously published under Q31881

SUMMARY

The /F (far call translation) and /PAC (or /PACKCODE or /PACKC) options of LINK.EXE version 5.01.20 should not both be used at the same time with Basic programs. That is, don't use the command line LINK /F/PACKC.

The following generic LINK information does NOT apply to Basic:

The LINK section on pages 276-278 of the "Microsoft CodeView and Utilities: Software Development Tools for MS-DOS" manual shipped with Basic Compiler 6.0/6.0b states that if the /F and /PAC options are used together, slightly faster code and smaller executable file size are generated. This is also stated on pages 241-242 and 248 of the "Microsoft CodeView 2.3 and Utilities User's Guide" shipped with Microsoft Basic Professional Development System (PDS) version 7.0 (this guide was not shipped with 7.1). /PACKCODE directs the linker to group together neighboring code segments, and /F optimizes far CALLs.

When you link compiled Basic routines with LINK /F/PACKC, the executable .EXE file size remains the same as the .EXE file size when linked without these options, and speed is not improved.

This information applies to the BC.EXE that comes with QuickBasic versions 4.0, 4.0b, and 4.5 for MS-DOS; to BC.EXE in Microsoft Basic Compiler versions 6.0 and 6.0b for MS-DOS and MS OS/2; and to BC.EXE in Microsoft Basic PDS versions 7.0 and 7.1 for MS-DOS and MS OS/2.

MORE INFORMATION

If you use both the /F and /PACKC options when you link a Basic PDS 7.0 or 7.10 program that requires a run-time module, the program will give a "Input path for run-time module" error at run time, and will not accept any path given to it. This symptom does not occur with an .EXE compiled in Basic compiler versions 6.0 and 6.0b. When compiled with QuickBasic 4.0 without /O and LINKed /F/PACKC, the .EXE hangs. Compiled with 4.0b without /O and LINKed /F/PACKC, the .EXE may cause an "EMM386 exception error". Compiled with QuickBasic 4.5 without /O and LINKed /F/PACKC, the .EXE may hang or print the screen to the printer.

The above error messages and hanging can be eliminated in any of the following ways:
  • Use the correct form of /PACKC:n with the required argument n (where n is the maximum number of code segments to pack into one group) -or-

  • Compile with /O (to make a stand-alone .EXE) -or-

  • LINK with either /F or /PACKC separately (but don't LINK with both /F and /PACKC together). Either /F or /PACKC:n can be used alone without problems.
The LINK.EXE /PACKCODE switch of the Microsoft Segmented-Executable Linker version 5.01.20, shipped with Microsoft Basic Compiler versions 6.0 and 6.0b for MS-DOS and MS OS/2, can be abbreviated with /PAC on the LINK command line. The same is true for the Microsoft Overlay Linker shipped with Microsoft QuickBasic versions 4.0, 4.0b, and 4.50. This abbreviation has changed to /PACKC in the Segmented-Executable Linker version 5.05 shipped with Microsoft Basic Professional Development System (PDS) versions 7.0 and 7.1 for MS-DOS and MS OS/2. Mistakenly using the older /PAC switch with Linker 5.05 gives error L1001 "Option name ambiguous." For more information on this change, query on the following words:

LINK AND PACKC AND PAC


Modification Type:MinorLast Reviewed:1/9/2003
Keywords:KB31881