Microsoft KB Archive/87528

{|
 * width="100%"|

FIX: L2057 Linking Code Compiled with /Gy into MOVE App

 * }

Q87528

-

The information in this article applies to:


 * Microsoft LINK for MS-DOS, version 5.3

-

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

error L2057: duplicate of &quot;function&quot; with different size found;

record ignored

CAUSE
The application was built using Microsoft C/C++ version 7.0, the compiler options include /Gy, and the program uses the Microsoft Overlaid Virtual Environment (MOVE).

RESOLUTION
To work around this problem, perform one of the following three steps:


 * Do not specify the /Gy compiler option when compiling the module that contains the function that causes the problem. The disadvantage to this method is that assigning information to overlays takes place only at the segment level instead of at the function level.
 * Rearrange the source code such that the function in question is not at the end of a segment. Alternately, if the FUNCTIONS statement in the module-definition (.DEF) file assigns functions to segments, specify a different segment that contains fewer functions.
 * Obtain and install the C/C++ version 7.0a patch disk. Obtain a disk from Microsoft. To obtain a disk in the United States, call Microsoft Product Support Services at (206) 454-2030. Outside the United States, contact the Microsoft subsidiary for your area. To locate your subsidiary, go to the Microsoft Web site http://www.microsoft.com/worldwide/default.htm

STATUS
Microsoft has confirmed this to be a problem in LINK version 5.3 for MS-DOS (distributed with C/C++ version 7.0). This problem was corrected in LINK version 5.31.009 for MS-DOS (distributed with the C/C++ version 7.0a patch disk).

MORE INFORMATION
The /Gy option instructs the compiler to package the function and make it visible to the linker with a COMDAT record. When the error occurs, the function that detects segment overflow counts the continuation blocks for a given COMDAT record twice when it should count them once. The L2057 error occurs when the COMDAT record is at the end of a segment.

Additional query words: 5.30

Keywords : kberrmsg kb16bitonly

Issue type : kbbug

Technology : kbAudDeveloper kbZNotKeyword3 kbLINKSearch kbLINK530DOS