BUG: Error: L2029: '__FPMATH':Unresolved external with /NOI

Last reviewed: July 18, 1997
Article ID: Q132853
1.51 1.52 WINDOWS kbprg kberrmsg kbbuglist kbcode

The information in this article applies to:

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

SYMPTOMS

The following linker error is generated when building an AppWizard- generated application using either version 1.51 or 1.52 of Visual C++:

   <path>\mfc\lib\mfc250d.lib(afxdll.asm) : error L2029: '__FPMATH'
                                          : unresolved external

This error is generated only when using the /NOI linker option (distinguish letter case), and linking to MFC in a DLL while using version 1.51 or 1.52 of Visual C++.

CAUSE

There is a reference made in the afxdll.asm file to the function

'void _fpmath(void)' in uppercase ( _FPMATH ). Without the /NOI
option, the linker resolves the symbol '_FPMATH' to '_fpmath' which is the correct behavior. However, with the /NOI option (distinguish letter case), the linker searches for the symbol '_FPMATH' and not
'_fpmath' which causes an unresolved external.

RESOLUTION

The error can be resolved by defining a function 'void _FPMATH(void)' in the application, and calling the function _fpmath() from within this function.

The following sample code illustrates this workaround. It should only be used when using the /NOI link option and linking to MFC in a DLL.

Sample Code

Add the following code to any one of the source files (.CPP) included in your project:

/* Compile options needed:
   /NOI - Distinguish Letter Case
   link with the MFC DLL library (mfc250(d).lib)
*/
... extern "C" void _fpmath(void); ... extern "C" void _FPMATH(void) {
   _fpmath();
}

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.


Additional reference words: 1.51 1.52 2.51 2.52
KBCategory: kbprg kberrmsg kbbuglist kbcode
KBSubcategory: MfcMisc
Keywords : kb16bitonly MfcMisc kbbuglist kbcode kberrmsg kbprg
Technology : kbMfc
Version : 1.51 1.52
Platform : WINDOWS


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