Hi,
I am working in linux Redhat7.1, P3 system.
Whenever I compile a program which has a math function, I use the command:
cc filename.c -lm
I have to do this inspite of including math.h
The errors that were displayed when I didnot use -lm are as follows:::
***********************************************
bash-2.04$ cc test.c
/tmp/ccUQaDNH.o: In function `main':
/tmp/ccUQaDNH.o(.text+0x1e): undefined reference to `sin'
/tmp/ccUQaDNH.o(.text+0x4a): undefined reference to `sqrt'
collect2: ld returned 1 exit status
bash-2.04$ cc test.c -lm
*---------------------------------------------
What does this -lm signify and why should I give this.
Ashesh