avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] strange behaviour with ceil()


From: E. Weddington
Subject: Re: [avr-gcc-list] strange behaviour with ceil()
Date: Thu, 25 Jul 2002 09:15:45 -0600 (Mountain Daylight Time)

I've ran into a similar problem before with math routines.
 
The error you're getting is a linker error. The linker cannot find these routines that are being called.
 
The math library is seperate from the standard library.
 
Add the libm.a library to the files you want to link together.
 
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
.
____________________________________________________
  IncrediMail - Email has finally evolved - Click Here

reply via email to

[Prev in Thread] Current Thread [Next in Thread]