PRB: LNK2001 Link Error on Floating Division Functions (128895)
The information in this article applies to:
- Microsoft Visual C++, 32-bit Editions 2.1
This article was previously published under Q128895 SYMPTOMS
Compiling a program containing floating point divisions and linking with
run-time libraries other than those supplied with Microsoft Visual C++
version 2.1 can result in LNK2001 unresolved external errors on the
following functions:
__adj_fdiv_m32
__adj_fdiv_m64
__adj_fdivr_m64
__adjust_fdiv
This can occur when linking to libraries such as CRTDLL.LIB or the run-time
libraries that came with Microsoft Visual C++ version 2.0.
CAUSE
The compiler and libraries that ship with Microsoft Visual C++ version 2.1
provide a method of avoiding Pentium division instructions. Pentium
division instructions can generate inaccurate results in some cases. The
compiler inserts calls to emulation functions instead of inserting floating
point processor instructions. These floating point division emulation
functions are in the run-time libraries shipped with version Visual C++
version 2.1, but not with earlier versions of the libraries.
RESOLUTION
The libraries and compiler that come with Microsoft Visual C++ version 2.1
are designed to work together. If other libraries must be used, use the
following compiler switch to force insertion of floating point processor
instructions instead of inserting calls to the emulation functions:
/QIfdiv- {use coprocessor instead of calls to functions}
STATUS
This behavior is by design.
Modification Type: | Minor | Last Reviewed: | 7/5/2005 |
---|
Keywords: | kbCRT kbprb KB128895 kbAudDeveloper |
---|
|