[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C problem



On Sun, 1 Aug 1999, Itamar S.-T. wrote:


gcc -o math math.c -lm

--Ariel

> Compiling the following example program:
> 	#include <math.h>
> 
> 	int main(void) {
>       	double x = sqrt(2.0);
>       	return 1;
> 	}
> 
> Gives me the following error:
> 	[itamar@porthos hashtest]$ gcc math.c
> 	/tmp/cc1Mfpzc.o: In function `main':
> 	/tmp/cc1Mfpzc.o(.text+0xe): undefined reference to `sqrt'
> 	collect2: ld returned 1 exit status
> 
> What is the problem here?I'm getting such an error any time I try to use
> functions from math.h.This is RH6 (glibc 2.1, egcs 1.1.2).
> 
> --
> Itamar - itamars@ibm.net
> 
> =================================================================
> To unsubscribe, send mail to linux-il-request@linux.org.il with
> the word "unsubscribe" in the message body, e.g., run the command
> echo unsubscribe | mail linux-il-request@linux.org.il
> 

--
Ariel Biener
e-mail: ariel@post.tau.ac.il           Work phone: 03-640608
fingerprint = 07 D1 E5 3E EF 6D E5 82 0B E9 21 D4 3C 7D 8B BC


=================================================================
To unsubscribe, send mail to linux-il-request@linux.org.il with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail linux-il-request@linux.org.il