BUG: Error: L2029: '__FPMATH':Unresolved external with /NOILast reviewed: July 18, 1997Article ID: Q132853 |
1.51 1.52
WINDOWS
kbprg kberrmsg kbbuglist kbcode
The information in this article applies to:
SYMPTOMSThe 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 externalThis 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++.
CAUSEThere is a reference made in the afxdll.asm file to the function 'void _fpmath(void)' in uppercase ( _FPMATH ). Without the /NOIoption, 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. RESOLUTIONThe 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 CodeAdd 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();}
STATUSMicrosoft 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
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |