/*
* floating point helper routines
*
* In the non-CRTDLL builds, these prototypes are immediately replaced by
* macros which replace them with calls through elements of the _cfltcvt_tab
* array, so we only pull them into a static-link build if floating point
* code is needed.
*/
这里是个宏
(*((PF6)_CFLTCVT_TAB(6)))(a,b,c,d,e,f,g)
修改方式即把.rdata的节的writeable给删除。 参考修改过的exe.
===========================
另外vs2008, 编译有些BUG可能会导致编译器错误的认为你不需要fpu,如
int main()
{
printf("%f", 3); // error , no reference
}
int main()
{
printf("%f", 3.0); // ok
}
//////////////////////
最后, 关于这个问题MSDN的解释
Error Message
floating-point support not loaded
The necessary floating-point library was not linked.
To fix by checking the following possible causes
The program was compiled or linked with an option, such as /FPi87, that requires a coprocessor, but the program was run on
a machine that did not have a coprocessor installed.
A format string for a printf_s or scanf_s function contained a floating-point format specification and the program did not
contain any floating-point values or variables.
The compiler minimizes a program's size by loading floating-point support only when necessary. The compiler cannot detect
floating-point format specifications in format strings, so it does not load the necessary floating-point routines.
Use a floating-point argument to correspond to the floating-point format specification, or perform a floating-point
assignment elsewhere in the program. This causes floating-point support to be loaded.
In a mixed-language program, a C library was specified before a FORTRAN library when the program was linked. Relink and