Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!sdd.hp.com!hplabs!hpfcso!hplisa!hplvli!boyne From: boyne@hplvli.HP.COM (Art Boyne) Newsgroups: comp.lang.c Subject: Re: Problem with Turbo C++ Message-ID: <27320001@hplvli.HP.COM> Date: 3 Oct 90 14:55:00 GMT References: Organization: Loveland Inst. Div Lines: 26 ghenniga@nmsu.edu (Gary Hennigan) writes: >To accomplish this I used this piece of code: > >for( nr=1; nr <= Anr; nr++) >{ > fscanf( inpfile, "%f\n", &A[nr][1] ); >} > >Now everything compiles fine but when I run it I get the following error: > > scanf : floating point formats not linked >Abnormal program terminaion. This is a known bug in Turbo C: because there are no floating point operations in the program other that the fscanf/fprintf, the compiler forgets to tell the linker to include the floating point library stuff. The solution is to add a dummy (never called) routine such as: int stupid_turbo_c() { double x = 1.0; return (int)x; } Art Boyne, boyne@hplvla.hp.com