I have the simmilar problem. Even adding '-lm ' doesnt help. I am still
getting undefined references. Using mspgcc-030306.exe build.

#include "math.h"

int  main (void)
{
        float fRes;

        fRes = fabs(1.4);               //links ok
        fRes = powf(55, 4);     //linker failes
        fRes = sqrt(1000);      //linker failes
        fRes = sinf(1.2);               //linker failes
        fRes = cosf(1.2);               //linker failes
        fRes = sinf(1.2);               //linker failes
        fRes = asinf(0.44);     //linker failes

        return 0;
}

D:\Software\MSP430\Apps\testx>gmake
msp430-gcc -mmcu=msp430x149 -lm -o Test.elf Test.o
Test.o(.text+0x12): In function `main':
/cygdrive/d/LBSSandbox/LT100/Software/MSP430/Apps/testx/Test.c:7: undefined
reference to `powf'
Test.o(.text+0x1c):/cygdrive/d/Software/MSP430/Apps/testx/Test.c:8:
undefined reference to `sqrt'
Test.o(.text+0x28):/cygdrive/d/Software/MSP430/Apps/testx/Test.c:9:
undefined reference to `sinf'
Test.o(.text+0x34):/cygdrive/d/Software/MSP430/Apps/testx/Test.c:10:
undefined reference to `cosf'
Test.o(.text+0x40):/cygdrive/d/Software/MSP430/Apps/testx/Test.c:11:
undefined reference to `sinf'
Test.o(.text+0x4c):/cygdrive/d/Software/MSP430/Apps/testx/Test.c:12:
undefined reference to `asinf'
gmake: *** [Test] Error 1

Any suggestions ?

Thanks,

Nenad

-----Original Message-----
From: mspgcc-users-ad...@lists.sourceforge.net
[mailto:mspgcc-users-ad...@lists.sourceforge.net]on Behalf Of Dmitry
Sent: Monday, February 03, 2003 2:02 PM
To: mspgcc-users@lists.sourceforge.net
Subject: Re: [Mspgcc-users] Math functions in math.h?


does -lm help?
~d

On Monday 03 February 2003 21:08, Mark Stokes wrote:
> I am using the pow( x,y) function as defined in math.h but don't know
> how to tell the linker where the library is.. Could someone help me?
> -Mark
>
>
>
> -------------------------------------------------------
> This SF.NET email is sponsored by:
> SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
> http://www.vasoftware.com
> _______________________________________________
> Mspgcc-users mailing list
> Mspgcc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mspgcc-users

--
/********************************************************************
     ("`-''-/").___..--''"`-._     (\   Dimmy the Wild      UA1ACZ
      `6_ 6  )   `-.  (     ).`-.__.`)  Enterprise Information Sys
      (_Y_.)'  ._   )  `._ `. ``-..-'   Nevsky prospekt,   20 / 44
    _..`--'_..-_/  /--'_.' ,'           Saint Petersburg,   Russia
   (il),-''  (li),'  ((!.-'             +7 (812)  3468202, 5585314
 ********************************************************************/



-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld =omething 2 See!
http://www.vasoftware.com
_______________________________________________
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users


Reply via email to