Contents Up << >>

Why does my DOS C++ program says "Sorry: floating point code not linked"?

The compiler attempts to save space in the executable by not including the float-to-string format conversion routines unless they are necessary, but sometimes it guesses wrong, and gives you the above error message. You can fix this by (1) using <iostream.h> instead of <stdio.h>, or (2) by including the following function somewhere in your compilation (but don't call it!):

static void dummyfloat(float *x) float y; dummyfloat(&y);

See FAQ on stream I/O for more reasons to use <iostream.h> vs <stdio.h>.