EmbeddedRelated.com
Forums

[MSP430] problems with exp, pow and log10

Started by Alex October 21, 2004
Hi everybody,
             I'm programming the msp430 using gcc as compiler. I have
noted today that some math fuctions, that are included in math.h and
libm.a,  are actually not supported.
For example, if I use the  sqrt() function I have no problems but, if
I try to use the pow() function, the linker fails to include this one.

I'm not so sure, but is it possible that some functions, even though
listed in the math.h as prototypes, actually are not present in the
library libm.a?

Suggestions?????

Ty in advance for any kind of answer,

                           Alex
Alex wrote:
> Hi everybody, > I'm programming the msp430 using gcc as compiler. I have > noted today that some math fuctions, that are included in math.h and > libm.a, are actually not supported. > For example, if I use the sqrt() function I have no problems but, if > I try to use the pow() function, the linker fails to include this one. > > I'm not so sure, but is it possible that some functions, even though > listed in the math.h as prototypes, actually are not present in the > library libm.a? > > Suggestions????? > > Ty in advance for any kind of answer, > > Alex
(As no-one with direct experience has replied) I had a similar problem on the H8300 toolchain, tracked down the lost objects to libgcc.a by listing each library with the library tool (can't remember what it was called). Then I just included it in my makefile. Regards, Mike. -- Mike Page BEng(Hons) MIEE www.eclectic-web.co.uk Quiet! Tony's battling the forces of conservatism, whoever we are.
Alex wrote:
> Hi everybody, > I'm programming the msp430 using gcc as compiler. I have > noted today that some math fuctions, that are included in math.h and > libm.a, are actually not supported. > For example, if I use the sqrt() function I have no problems but, if > I try to use the pow() function, the linker fails to include this one. > > I'm not so sure, but is it possible that some functions, even though > listed in the math.h as prototypes, actually are not present in the > library libm.a? > > Suggestions????? > > Ty in advance for any kind of answer, > > Alex
Did you remember to include the math library (-lm) on the linking command line after the source needing it? Example: gcc -o myfile.obj myfile.c -lm Tauno Voipio tauno voipio (at) iki fi
Sure! 
The problem that I have mentioned is only for the subsequent fuctions:
pow(), exp(), log() and log10().
the others work well...

> Did you remember to include the math library (-lm) on the > linking command line after the source needing it? > > Example: > > gcc -o myfile.obj myfile.c -lm > > Tauno Voipio > tauno voipio (at) iki fi