Microsoft KB Archive/37507

= PRB: &quot;Floating-point Support Not Loaded&quot; Error with scanf =

Article ID: 37507

Article Last Modified on 9/17/2003

-

APPLIES TO

 The C Run-Time (CRT), when used with:  Microsoft C Professional Development System 6.0

 Microsoft C Professional Development System 6.0a

 Microsoft C Professional Development System 6.0a

 Microsoft C Professional Development System 6.0</li></ul>

 Microsoft C Professional Development System 6.0a</li></ul>

 Microsoft C/C++ Professional Development System 7.0</li></ul>

 Microsoft Visual C++ 1.0 Professional Edition</li></ul>

 Microsoft Visual C++ 1.5 Professional Edition</li></ul>

 Microsoft Visual C++ 5.0 Learning Edition</li></ul>

 Microsoft Visual C++ 2.0 Professional Edition</li></ul>

 Microsoft Visual C++ 4.0 Professional Edition</li></ul>

 Microsoft Visual C++ 5.0 Professional Edition</li></ul>

<ul> <li>Microsoft Visual C++ 6.0 Professional Edition</li></ul> </li></ul>

-

<div class="notice_section">

This article was previously published under Q37507

<div class="notice_section">

<div class="symptoms_section">

SYMPTOMS
When an application uses the scanf function to read a floating-point value from the console into an uninitialized &quot;float&quot; type global variable, an R6002 &quot;floating-point format support not loaded&quot; error occurs. This error also occurs when any formatted input routine is used to read a value.

<div class="cause_section">

CAUSE
The compiler does not generate a reference to the __fltused variable that instructs the linker to load the floating-point support module.

<div class="resolution_section">

RESOLUTION
To work around this problem, initialize the floating-point variable or use the variable in an expression in the routine that contains the scanf call.

<div class="status_section">

STATUS
This behavior is expected. To minimize the size of the executable file, the compiler loads floating-point support only when it is required.

<div class="moreinformation_section">

MORE INFORMATION
When a module uses only one of the formatted input routines and does not also initialize a floating-point variable, the compiler does not load floating-point support.

Remove the comment indication from either or both of the two lines in the sample code below to eliminate the R6002 error.

Sample Code
/*   * Compile options needed: none */

#include <stdio.h>  float x ;

main {  // Remove the comment from the next line to eliminate the error. // x = 2.3 ;

scanf (&quot;%f&quot;, &x) ;

// Remove the comment from the next line to eliminate the error. // printf (&quot;%f\n&quot;, x) ; }

Additional query words: floating point not loaded

Keywords: kbprb KB37507

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.