On Tue, 17 Aug 2004 23:15, Torfs Tom wrote:
> Everyone,
>
> By the way, even though I forgot to include #math.h in my minimal example,
> this does not make a difference, identical results with this version:
>
> /* minimal program showing math linking problems */
>
> #include <math.h>
>
> int main(void)
> {
> float a,b,c;
>
> a = 1.234;
> b = 5.678;
> c = pow(a,b);
>
> return 0;
> }
>
> W:\msp430\stack-code>msp430-gcc -g -mmcu=msp430x149 -o2 -lm fptest.c -o
> fptest.elf
> /cygdrive/c/DOCUME~1/torfst/LOCALS~1/Temp/ccZtdM8k.o(.text+0x2e): In function
> `main':
> /cygdrive/w/msp430/stack-code/fptest.c:11: undefined reference to `pow'
>
> greetings,
> Tom
G'day,
The libm library doesn't appear to have pow() but powf(), see below:
husky# nm /usr/pkg/msp430/lib/msp2/libm.a | grep pow
ef_pow.o:
00000018 T __ieee754_powf
00001248 T powf
The prototype for this function is
float powf(float x, float y);
You may want to try it with this function.
cheerio Berndt