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

ID: Q99602

1.02 2.00 2.50 2.50a | 2.50 2.50a

MS-DOS               | WINDOWS
kbtool   kbprb

The information in this article applies to:

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   kbprb kbtshoot
KBSubcategory: FxtoolProjman
Keywords          : kberrmsg FxtoolProjman 
Version           : 1.02 2.00 2.50 2.50a | 2.50 2.50
Platform          : MS-DOS WINDOWS

Last Reviewed: May 22, 1998