This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Problem with header files.
- To: gcc-help at gcc dot gnu dot org
- Subject: Problem with header files.
- From: Matt R <nimrod99 at dingoblue dot net>
- Date: Sat, 4 Aug 2001 09:41:13 +1000
- Reply-To: nimrod99 at dingoblue dot net
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