public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Problem with header files.
@ 2001-08-03 16:32 Matt R
  2001-08-03 16:43 ` David Berthelot
  2001-08-03 16:49 ` Alexandre Oliva
  0 siblings, 2 replies; 4+ messages in thread
From: Matt R @ 2001-08-03 16:32 UTC (permalink / raw)
  To: gcc-help

Dear GCC Gurus, 
I have a problem getting GCC to refer to header files.
For example the following program....
------------Code Begins Here------------
#include <stdio.h>
#include <math.h>


main() {
    float uno;
    float  duo;
    uno=7.778;
    duo=sqrt(uno);
    printf("sqrt of %f is %f \n", uno, duo);
}

------------Code Ends Here--------------
Produces the following message at compile time...

[fakeuser@fakehost BeginC]$ gcc trial.c
/tmp/ccBm2UFL.o: In function `main':
/tmp/ccBm2UFL.o(.text+0x1b): undefined reference to `sqrt'
collect2: ld returned 1 exit status */

__________________________________________

What is going on?  I would really appreciate your advice on this
one.  I have to admit to being a newbie to C programing.
I have installed glibc 2.2.12 (full install), and gcc 2.9.6-85, and 
am using RedHat 7.0 distro.  The original versions of glibc gave the 
same errors.

Looking forward to your advice...otherwise I will end up doin my
iminent assignments on DOS....a fate worse than death.

Matt Redding

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2001-08-03 17:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-03 16:32 Problem with header files Matt R
2001-08-03 16:43 ` David Berthelot
2001-08-03 16:49 ` Alexandre Oliva
2001-08-03 17:52   ` Problem with header files. YeHaaaaaa!!!!! Matt R

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).