471,049 Members | 1,575 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,049 software developers and data experts.

floating format not linked

struct symbol
{
char ch;
float probability;
char *codeword;
};

void get_user_input(struct symbol **sptr)
{
.....
scanf("%c%f",&((*sptr)[i].ch),&((*sptr)[i].probability));
.....
}

Turbo C++ compiler (3.0) gave me
"floating point formats not linked. Abnormal program termination"
error.

If I scanned them into temp. vars and then assigned indivisually it
works just fine....

May I know what's problem here, compiler bug.....?

Nov 15 '05 #1
4 9382
"Rajesh" <ra**************@yahoo.co.in> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
struct symbol
{
char ch;
float probability;
char *codeword;
};

void get_user_input(struct symbol **sptr)
{
....
scanf("%c%f",&((*sptr)[i].ch),&((*sptr)[i].probability));
....
}

Turbo C++ compiler (3.0) gave me
"floating point formats not linked. Abnormal program termination"
error.

If I scanned them into temp. vars and then assigned indivisually it
works just fine....

May I know what's problem here, compiler bug.....?


It's your bug. You didn't link the math library in. It comes in different
library than the rest of the standard functions. If you're using the IDE,
find in the options the checkbox that enables linking of the math library.
If you're compiling and linking from command line, give the linker the
appropriate library file name (math?.lib). If you're compiling manually
through command line, make sure you choose libraries for the same memory
model, which is used for compilation (tiny, small, meduim, large, huge).

HTH,
Alex
Nov 15 '05 #2
"Rajesh" <ra**************@yahoo.co.in> wrote:
struct symbol
{
char ch;
float probability;
char *codeword;
};

void get_user_input(struct symbol **sptr)
{
....
scanf("%c%f",&((*sptr)[i].ch),&((*sptr)[i].probability));
....
}

Turbo C++ compiler (3.0) gave me
"floating point formats not linked. Abnormal program termination"
error.

If I scanned them into temp. vars and then assigned indivisually it
works just fine....

May I know what's problem here, compiler bug.....?


That's not a question about C, but about a specific implementation.

Searching Google for Borland "floating point formats not linked"
will give you the desired information.

Best regards
--
Irrwahn Grausewitz (ir*******@freenet.de)
welcome to clc : http://www.ungerhu.com/jxh/clc.welcome.txt
clc faq-list : http://www.faqs.org/faqs/C-faq/faq/
clc frequent answers: http://benpfaff.org/writings/clc
Nov 15 '05 #3
Rajesh wrote:
struct symbol
{
char ch;
float probability;
char *codeword;
};

void get_user_input(struct symbol **sptr)
{
....
scanf("%c%f",&((*sptr)[i].ch),&((*sptr)[i].probability));
....
}

Turbo C++ compiler (3.0) gave me
"floating point formats not linked. Abnormal program termination"
error.

If I scanned them into temp. vars and then assigned indivisually it
works just fine....

May I know what's problem here, compiler bug.....?


It's a FAQ http://www.eskimo.com/~scs/C-faq/q14.3.html
Not exactly your question, but the same problem. You will have to either
read the manuals for you compiler or ask where your compiler is on topic
to find out how to get the maths libraries linked in.

Please check the FAQ for answers to other questions before posting them
here, that is what FAQs are for!
--
Flash Gordon
Living in interesting times.
Although my email address says spam, it is real and I read it.
Nov 15 '05 #4
Rajesh wrote:
[...]
Turbo C++ compiler (3.0) gave me
"floating point formats not linked. Abnormal program termination"
error.


Please check the FAQ before posting.

<http://www.eskimo.com/~scs/C-faq/q14.13.html>
Question 14.13

I'm having trouble with a Turbo C program which crashes and says
something like ``floating point formats not linked.''

Some compilers for small machines, including Borland's (and Ritchie's
original PDP-11 compiler), leave out certain floating point support if
it looks like it will not be needed. In particular, the
non-floating-point versions of printf and scanf save space by not
including code to handle %e, %f, and %g. It happens that Borland's
heuristics for determining whether the program uses floating point are
insufficient, and the programmer must sometimes insert an extra,
explicit call to a floating-point library routine to force loading of
floating-point support. (See the comp.os.msdos.programmer FAQ list for
more information.)

Read sequentially: prev next up top

This page by Steve Summit // Copyright 1995 // mail feedback
Nov 15 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Ravi | last post: by
6 posts views Thread by sreelal | last post: by
10 posts views Thread by Bryan Parkoff | last post: by
8 posts views Thread by neha | last post: by
8 posts views Thread by rdemyan via AccessMonster.com | last post: by
7 posts views Thread by thisismyidentity | last post: by
4 posts views Thread by john | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.