The information in this article applies to:
SYMPTOMSAttempting to replace the default _matherr function with a user-defined version and then linking with the C run-time dynamic-linked library (DLL) causes the compiler to issue the following warning: Running the resultant executable causes the default _matherr to be used rather than the user-defined version. CAUSEThe compiler issues the C4273 warning because of the way the _matherr function is prototyped in the MATH.H header file. _matherr has the following prototype:
When code is being compiled to be used with the C run-time DLL, _CRTIMP is
defined to be the following:
When code is being compiled to be used with one of the statically linked C
run-time libraries, _CRTIMP is defined to be nothing.
The C4273 warning is generated because the compiler has detected a redefinition of _matherr after already seeing a prototype that specifies that _matherr is being imported. RESOLUTION
It is not possible to replace the default version of _matherr when using
the dynamically linked version of the C run-time library.
CRTDLL.DLL is the name of the C Run-time DLL that is supplied with Windows
NT. The C Run-time DLL supplied with version 1.0 of Visual C++, 32-bit
Edition, is called MSVCRT10.DLL and the name of the C Run-time DLL supplied
with version 2.0 of Visual C++, 32-bit Edition is MSVCRT20.DLL. The
limitation of not being able to replace _matherr pertains only to using
MSVCRT*.DLL.
MORE INFORMATIONThe following sample code can be used to demonstrate the problem. Sample Code
REFERENCEFor additional information, please see the following article in the Microsoft Knowledge Base:Q112297 INFO: User Defined CRT Function Causes Unresolved External Additional query words: _matherrl
Keywords : kbCRT kbVC |
Last Reviewed: September 10, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |