red hat 9.0 gcc (ceil, floor and sqrt function errors) ??
hi !
I just recently started working in linux red hat 9.0 to compile my C programs , I am using the gcc command but the program is giving me weird errors and does not recognize the functions ceil(), floor() and sqrt(), I have tried and added most header files like math.h nad stdlib.h along with stdio.h but I keep getting wried errors like : Quote:
The program is as follows #include<stdio.h> #include<stdlib.h> #include<math.h> Code:
int main() |
These are linker errors, not compiler errors; hence the “ld”. You will find these functions in the m (maths) library (/usr/lib/libm.so), and you can make this compile using:
Code:
gcc -lm infile.c outfile To find out which header file a function is declared in, just look at its manpage: Code:
man ceil |
All times are GMT -5. The time now is 12:27 PM. |