Hi all, I still cannot compile my project with cos() and sin() function. I don't know why. It seems taht libm is not here. Why and what i could do?
Thank for your help Sébastien > Message du 20/05/08 à 22h41 > De : "Alessandro Rubini" <[EMAIL PROTECTED]> > A : [email protected] > Copie à : > Objet : Re: [foxboard] Trigonometrics function > > > > lcd.c:126: undefined reference to `cos' > > This is definitely a missing libm. > > > Even if i include "math.h" with or not -lm compilation parameters > > "-lm" works for me, as expected: > > ostro% cat > /tmp/trig.c > int main(int argc, char **argv) {return sin(atof(argv[1]));} > ^D > ostro% gcc /tmp/trig.c -o /tmp/trig > /tmp/cc6DCmZH.o(.text+0x2c): In function `main': undefined reference to > `sin' > collect2: ld returned 1 exit status > Exit 1 > ostro% gcc -lm /tmp/trig.c -o /tmp/trig > ostro% > > But please note that some toolchains require "-lm" to go last (i.e., _after_ > the source or object file where the undefined symbol is encountered). > > /alessandro > ____________________________________________________ Vous aussi bénéficiez d'1 Go de stockage gratuit en ligne avec Voila http://macle.voila.fr
