gcc and math.h
i wrote a program that is supposed to print the sin, cos and sqrt of some float. i include math.h. but when i try to compile i get
why doesnt it find those functions?
tmp/cc2oPQ8z.o(.text+0x1ad): In function `main':
: undefined reference to `cos'
/tmp/cc2oPQ8z.o(.text+0x1e3): In function `main':
: undefined reference to `sin'
/tmp/cc2oPQ8z.o(.text+0x21c): In function `main':
: undefined reference to `sqrt'
/tmp/cc2oPQ8z.o(.text+0x231): In function
gcc -Wall -lm filename.c
>gcc -Wall -lm filename.c
Maybe not. :)
There, that's better. :)
gcc -Wall filename.c -lm
thanks a lot , it works now:)