Dear Anand Kumar Saha and all other helpful friends,
Sorry for being late to respond: now it worked nicely.
But even after knowing this option ('-lm in compilation command and <math.h> 
in the code) and seeing that it works it was so difficult to track down all 
the command strands from man.gcc.
If any free electronic text on NET you know --  that can be helpful, please 
suggest. 
Really, once again, at this age, I have started learning computers, the whole 
credit goes to you -- all kind lug friends.
dipankar das

On Monday 29 September 2003 10:42, Anand Kumar Saha wrote:
> hi,
>
> use:
> $ gcc -lm program_name.c
>
> to link the math library.
>
> saha
>
> > -----Original Message-----
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> > Sent: Monday, September 29, 2003 10:23 AM
> > To: [EMAIL PROTECTED]
> > Subject: [ilug-cal] math.h
> >
> >
> > Dear Friends
> > Can anyone tell me about any reported bug
> > in GCC math header?
> > Even a very simple code with a reference to <math.h> is
> > failing regularly.
> >
> > Here is the super-intelligent code-let, lifted
> > directly from C Complete Reference by Schildt,
> > 4th Ed, page 409:
> >
> >
> > #include <math.h>
> > #include <stdio.h>
> > int main (void)
> > {
> >  double x = 10.0, y = 0.0;
> > do
> >  {
> >    printf("%f\n", pow(x,y));
> >    y++;
> >  }
> > while (y < 11.0);
> > return 0;
> > }
> >
> > Compiling this with gcc both version 3.2.2 in Slack or
> >
> > 3.3 in SuSE is giving the same message. Like this:
> > >>/tmp/ccmcLWjH.o(.text+0x3f): In function `main':
> > >>home/dd/works/c/garbage/tenpow.c:8: undefined reference to `pow'
> >
> > This same thing is happening with 'sqrt' or cube or anything
> > that invokes math.h
> > Is there any known trick?
> >
> > dipankar das
> >
> > --
> > To unsubscribe, send mail to [EMAIL PROTECTED] with the body
> > "unsubscribe ilug-cal" and an empty subject line.
> > FAQ: http://www.ilug-cal.org/node.php?id=3
>
> This message is confidential and is intended only for the individual named.
> It may also be privileged or otherwise protected by work product immunity
> or other legal rules. If you are not the named addressee you should not
> disseminate, distribute or copy this e-mail. Please notify the sender
> immediately by e-mail if you have received this e-mail by mistake and
> delete this e-mail from your system. E-mail transmission cannot be
> guaranteed to be secure or error-free as information could be intercepted,
> corrupted, lost, destroyed, arrive late or incomplete, or contain viruses.
> The sender therefore does not accept liability for any errors or omissions
> in the contents of this message, which arise as a result of e-mail
> transmission. If verification is required please request a hard-copy
> version. Please note that any views or opinions presented in this email are
> solely those of the author and do not necessarily represent those of the
> company. Finally, the recipient should check this ! email and any
> attachments for the presence of viruses. The company accepts no liability
> for any damage caused by any virus transmitted by this email.
>
>
>
>
>
> --
> To unsubscribe, send mail to [EMAIL PROTECTED] with the body
> "unsubscribe ilug-cal" and an empty subject line.
> FAQ: http://www.ilug-cal.org/node.php?id=3

--
To unsubscribe, send mail to [EMAIL PROTECTED] with the body
"unsubscribe ilug-cal" and an empty subject line.
FAQ: http://www.ilug-cal.org/node.php?id=3

Reply via email to