[comp.lang.c] Turbo C 2.0 not linking printf f.p. formats

afc@mace.cc.purdue.edu (Greg Flint) (05/07/91)

In <11067@hub.ucsb.edu> jackg@capella.ucsb.EDU (Jack Greenbaum) writes:

>Within a graphics based application written using Turbo C 2.0 I use 
>sprintf("%f ...., but when the program gets there it aborts and prints
>the run-time error message "printf : floating point formats not linked". 
>The program runs correctly if I remove this line.

>Just for fun I put a printf("%f\n",1.0) as the first line in the program, 
>and got the same error.

This problem also exists with Turbo C++ version 1.01.

Borland knows about this error and has the following work-around:

	1) add the line "#include <math.h>" to your list of include files.
	2) call some math function to a dummy float variable, e.g., use
		float dummy;
		dummy = cos (1.0);

The floating point libraries will now be loaded for use with the [sf]printf
functions.

I found this out after calling Borland and waiting the usual 20 minutes on
hold -- which brings me to the question:  Is there any place that Borland
posts such known bugs and, if available, work-arounds?   If so, where?
And would someone reading the list be willing to post updates to it to the
net?  Or archive it at an ftp-accessable site?

....Greg Flint (afc@klaatu.cc.purdue.edu)