dharmes

June 10th, 2012, 12:29 PM

i have written a program,

were i have to find a square root of a function.

but i get the following error while compilation.

dharmesh@dharmesh-ThinkPad-SL400:~/bg/ch5$ gcc -Wall p10.c -o p10.o

/tmp/cckBRHAS.o: In function `main':

p10.c:(.text+0xf0): undefined reference to `sqrt'

p10.c:(.text+0x134): undefined reference to `sqrt'

collect2: ld returned 1 exit status

dharmesh@dharmesh-ThinkPad-SL400:~/bg/ch5$

i have used the header file math.h, and can't find any error in my simple program,

kindly give a sol to my problem!

were i have to find a square root of a function.

but i get the following error while compilation.

dharmesh@dharmesh-ThinkPad-SL400:~/bg/ch5$ gcc -Wall p10.c -o p10.o

/tmp/cckBRHAS.o: In function `main':

p10.c:(.text+0xf0): undefined reference to `sqrt'

p10.c:(.text+0x134): undefined reference to `sqrt'

collect2: ld returned 1 exit status

dharmesh@dharmesh-ThinkPad-SL400:~/bg/ch5$

i have used the header file math.h, and can't find any error in my simple program,

kindly give a sol to my problem!