Microsoft KB Archive/31881

= LINK /PAC and /F Options Are Not Supported by Basic Compiler =

Article ID: 31881

Article Last Modified on 11/21/2006

-

APPLIES TO


 * Microsoft QuickBasic 4.0, when used with:
 * Microsoft MS-DOS 6.22 Standard Edition
 * Microsoft QuickBASIC 4.0b, when used with:
 * Microsoft MS-DOS 6.22 Standard Edition
 * Microsoft QuickBasic 4.5 for MS-DOS, when used with:
 * Microsoft MS-DOS 6.22 Standard Edition
 * Microsoft BASIC Compiler 6.0
 * Microsoft BASIC Compiler 6.0b
 * Microsoft BASIC Professional Development System 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 &quot;Microsoft CodeView and Utilities: Software Development Tools for MS-DOS&quot; 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 &quot;Microsoft CodeView 2.3 and Utilities User's Guide&quot; 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 &quot;Input path for run-time module&quot; 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 &quot;EMM386 exception error&quot;. 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 &quot;Option name ambiguous.&quot; For more information on this change, query on the following words:

LINK AND PACKC AND PAC

Additional query words: QuickBas BasicCom 4.00 4.00b 4.50 6.00 6.00b 7.00 7.10

Keywords: KB31881

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.