Hi,

with an inspiration i found the secret trick: -lm has to be used as the last 
argument:

> msp430-gcc -mmcu=msp430x149 -O2 -Wall -g  -c -o test2.o test2.c 
> msp430-gcc -mmcu=msp430x149 -o test2.elf test2.o -lm
> echo $?
0

This trick is not nessisary e. g. on PC or ARM or for crosscompiling for ARM.
The trick is so secret that in the code examples there is no
#include <math.h>
and the trick can't be found in the manual!

Regards,

Rolf


[email protected] schrieb am 02.07.05 02:01:19:
> 
> 
> Hi,
> 
> i built mspgcc from the CVS sources of yesterday but sinf, logf etc. still
> do not work, even with #include <math.h>:
> 
> > msp430-gcc -mmcu=msp430x149 -lm -o test2.elf test2.c
> /tmp/ccm6TMBK.o(.text+0xe0): In function `main':
> : undefined reference to `expf'
> 
> That hello world program can be compiled, flashed and it works without
> problems when i comment the line with expf. So it's only expf that does
> not work.
> So is it vaporware or is there a special trick?
> 
> Regards,
> 
> Rolf
> 
> [email protected] schrieb am 03.06.05 18:41:14:
> > 
> > fixed...
> > logf(), expf()
> > 
> > ~d
> > 
> > On Friday 03 June 2005 07:54, Dmitry wrote:
> > > > But why -lm has to be given at the end?
> > >
> > > that's how the one-pass linker works...
> > >
> > > > > looks like I forgot to add strait calls of these functions...
> > > >
> > > > O.k.. Do you add this bug to the bug tracker at sourceforge.net? (So I
> > > > can monitor, if the bug has been fixed.)
> > >
> > > I'll fix it, say, tonight...
> > >
> > > cheers,
> > > ~d
> > >
> > > > Ralf


Reply via email to