FIX: L2025 Error on CWnd::DoDataExchange or CObject::Serialize

Last reviewed: September 18, 1997
Article ID: Q134984
1.50 1.51 1.52 WINDOWS kbprg kbbuglist kbfixlist kberrmsg

The information in this article applies to:

  • The Microsoft Foundation Classes (MFC) included with: Microsoft Visual C++ for Windows, versions 1.5, 1.51, 1.52

SYMPTOMS

Large MFC applications built for DEBUG may generate the following error messages:

   c:\msvc\mfc\lib\lafxcwd.lib(afxinl1.cpp) : error L2025 :
   DoDataExchange@CWnd@@NECXPAVCDataExchange@@@Z : symbol defined more
   than once

   c:\msvc\mfc\lib\lafxcwd.lib(afxinl1.cpp) : error L2025 :
   Serialize@CObject@@VECXAEVCArchive@@@Z : symbol defined more
   than once

This problem occurs only when building a standalone MFC application for DEBUG.

CAUSE

This problem is due to the fact that these functions were defined differently in Vbcore.obj. Vbcore.obj is the module that encapsulates MFC's VBX emulation layer. The problem occurs when the linker picks up the CWnd::DoDataExchange or CObject::Serialize functions from Vbcore.obj, which has the undesirable version.

RESOLUTION

To work around this problem, extract the file Afxinl1.obj from the file Lafxcwd.lib and add it to the miscellaneous link options for the debug build of the project. To extract the file, use the Lib.exe utility with the following command-line arguments:

   LIB LAFXCWD.LIB *AFXINL1.OBJ ;

To add the file (Msvc\Mfc\Lib\Afxinl1.obj) to the miscellaneous link options, follow these steps:

  1. On the Options menu in the Visual Workbench, click Project.

  2. From the Project Options dialog box, bring up the Linker Options.

  3. Select the Debug Specific option under Build Options.

  4. From the Category list, select Miscellaneous.

  5. In the Other Options box, enter Afxinl1.obj.

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. The problem with CObject::Serialize was corrected in Visual C++ version 1.52 for Windows, and the problem with CWnd::DoDataExchange was corrected in Visual C++ version 1.52b for Windows.


Additional reference words: 1.50 1.51 1.52 2.50 2.51 2.52 5.50 5.60
KBCategory: kbprg kbbuglist kbfixlist kberrmsg
KBSubcategory: MfcMisc
Technology : kbMfc
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 18, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.