PRB: "Invalid Object Module" Error Usually From Old LINK

ID: Q22331

5.10 6.00 6.00a 6.00ax 7.00 | 1.00 1.50

MS-DOS                      | WINDOWS
kbtool kbfasttip kbprb

The information in this article applies to:

SYMPTOMS

An attempt to link an application fails and the Microsoft LINK utility generates the following message:

      invalid object module

CAUSE

An incorrect version of Microsoft LINK is in use. In many systems, the MS-DOS directory is listed near the beginning of the PATH environment variable. MS-DOS includes a version of LINK that is often used instead of the version provided with the C compiler.

RESOLUTION

Perform one of the following two steps to address this problem:

MORE INFORMATION

To verify that an incorrect linker version is the cause of an "invalid object module" error, perform the following six steps:

1. Change the current directory to the directory in which the LINK.EXE

   version provided with the C compiler is installed.

2. Type "link" (without the quotation marks) at the MS-DOS command
   prompt.

3. When LINK displays its copyright banner message, note the displayed
   version number. This is the correct version of LINK to use.

4. Press CTRL+C to exit LINK.

5. Change the correct directory to the directory in which you compile

   and link your application.

6. Repeat steps 2 through 4 in this directory.

If the LINK version number that displays in your working directory is less than the version number that displays in the C compiler directory, then an older version of the LINK utility is installed in a directory listed in the PATH environment variable before the directory that contains the correct LINK version.

If you have an older version of LINK.EXE installed on your system, determine the directory in which it is installed. Most likely, it is in your MS-DOS directory. However, it could be the linker from another Microsoft language product.

Because it is not uncommon to have a number of linkers in various directories specified in the PATH, repeat the test above after you make any of the modifications recommended in the RESOLUTION section of this article.

Additional reference words: 1.00 1.50 5.10 6.00 6.00a 6.00ax 7.00 KBCategory: kbtool kbfasttip kbprb KBSubcategory: LinkIss Keywords : kb16bitonly

Last Reviewed: July 18, 1997