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

Last reviewed: September 16, 1997
Article ID: Q87528
5.30 | 5.30 MS-DOS | WINDOWS kbtool kberrmsg kbbuglist kbfixlist

The information in this article applies to:

  • Microsoft LINK for MS-DOS and Windows, version 5.3

SYMPTOMS

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

   error L2057: duplicate of "function" 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 reference words: 5.30
KBCategory: kbtool kberrmsg kbbuglist kbfixlist
KBSubcategory: LinkIss
Keywords : kb16bitonly LINKIss kbbuglist kberrmsg kbfixlist kbtool
Version : 5.30 | 5.30
Platform : MS-DOS WINDOWS
Solution Type : kbfix


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: September 16, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.