I forgot to mention that when you remove the call to ceil(), you
don't get an error for the call to sin() because the return value from
sin() gets stored in the variable a which then doesn't get used anywhere
and is optimized out, hence no more call to sin(), no linker error for
sin().
Eric
-------Original Message-------
Date: Wednesday, July
24, 2002 11:43:16 PM
Subject: [avr-gcc-list]
strange behaviour with ceil()
Hi,
The code below gives errors of undefined
reference to 'sin' and undefined reference to 'ceil'
When I
remove the line: "m = ceil(a);"
the errors go away but I need to
use ceil in my code. I spent an hour trying to find why this is an
error with no luck! Please help! :)
Here is the code that has
an error in it somewhere..:
#include <io.h> #include
<progmem.h> #include <float.h> #include <math.h>
int calc() { float a; float m; a = sin(30); m =
ceil(a); return m; }
int main(void) { float i; i =
calc(); }
avr-gcc-list at http://avr1.org . |