PRB: "Link Command Failed" When Linking Stand-Alone .EXE File

Last reviewed: April 29, 1996
Article ID: Q99602
The information in this article applies to:
  • Microsoft FoxPro for MS-DOS, versions 1.02, 2.0, 2.5, and 2.5a
  • Microsoft FoxPro for Windows, versions 2.5 and 2.5a

SYMPTOMS

When you are trying to link a stand-alone .EXE file, you receive a "Link Command Failed" error message.

CAUSE

This error is caused by insufficient conventional memory, which is probably occurring because other programs and/or drivers are running simultaneously with FoxPro.

RESOLUTION

Make More Conventional Memory Available

To resolve this problem, you need to make more conventional memory available. The easiest way to do this is by booting "clean" (that is, booting with a minimal configuration).

The following batch files make it easy to switch between a clean environment and your normal environment.

WARNING: Before you make any modifications to your CONFIG.SYS file, you should make a bootable system disk (see your MS-DOS documentation) so that the machine can be booted from a floppy disk if necessary.

  1. At the MS-DOS command prompt, type the following commands:

          copy config.sys *.nrm
          copy autoexec.bat *.nrm
    

  2. Use a text editor to add the following lines to a file named CONFIG.CLN:

          files=40
          buffers=20
          (Add a disk driver, if needed)
    

  3. Use a text editor to add the following lines to a file named AUTOEXEC.CLN:

          path c:\;c:\dos
          prompt $p$g
          (add c:\mouse\mouse if desired)
    

  4. Use a text editor to add the following lines to a file named CLENBOOT.BAT:

          copy config.cln *.sys
          copy autoexec.cln *.bat
    

  5. Use a text editor to add the following lines to a file named NORMBOOT.BAT:

          copy config.nrm *.sys
          copy autoexec.nrm *.bat
    

NOTE: If SMARTDrive is running, add the following line to CLENBOOT.BAT and NORMBOOT.BAT to ensure that the SMARTDrive memory cache is flushed (written to disk) before the machine is rebooted:

    smartdrv /c

Whenever you need a clean boot in order to link a file, type "CLENBOOT" (without the quotation marks) at the MS-DOS command prompt, press RETURN, and then reboot the machine. Once the .EXE file has been linked, type "NORMBOOT" (without the quotation marks), press RETURN, and reboot the machine again.

Additional Troubleshooting

If the steps above do not resolve this problem, try the following:

  1. Verify that FOXSWAP.COM is in the main FoxPro directory. This file allows FoxPro to swap memory out to a swap file on disk.

  2. Verify that the configuration file (usually CONFIG.FP or CONFIG.FPW) does NOT contain the line DOSMEM=ON. If this line is present, it prevents FoxPro from using FOXSWAP.COM.

  3. Verify that the MS-DOS environmental variable TEMP points to a valid directory.

    To test this, type "SET" (without the quotation marks) at an MS-DOS prompt, or run the Microsoft Diagnostic utility (MSD.EXE) included with Windows. This utility reports an error at start-up if the TEMP variable doesn't point to a valid directory.

    NOTE: Do not run MSD.EXE from Windows - quit Windows first and run it directly from MS-DOS.

  4. Verify that the MS-DOS environmental variable COMSPEC points to a valid COMMAND.COM file. COMSPEC is sometimes reset by batch files or scripts when logging onto a network.

    Again, use the type "SET" (without the quotation marks) at the MS-DOS prompt to view this variable.

  5. Try building the .EXE file directly from the Command window, bypassing the Project Manager, by typing the following in the Command window:

          BUILD EXE <exe_file> FROM <project_file> EXTENDED
    

    The Project Manager uses up some memory, and sometimes not using it frees up enough memory to allow the .EXE file to be built.

  6. Verify that WLINK8.EXE is in the main FoxPro directory.

    If this WLINK8.EXE isn't present, you will receive a "Bad command or file name" error message immediately before receiving the error that the link command failed.

    The easiest way to place WLINK8.EXE in the directory again is to reinstall the Distribution Kit.

STATUS

This behavior is by design.


Additional reference words: FoxDos FoxWin 2.00 2.50 dkit distribution kit
wlink errmsg err msg low 2.50a tshoot
KBCategory: kbtool kbprg kberrmsg kbprb kbtshoot
KBSubcategory: FxtoolProjman


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: April 29, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.