Hi Eric,

Thanks. Yes. I agree. sqrt and pow can be implemented by shift the bits
instead. How about MOD? for example, b=a%2. Is any other possible solution
instead of using the functions? Thanks.

Regards,
Bai

On Wed, Jan 28, 2009 at 11:53 AM, Eric Decker <[email protected]> wrote:

> I suspect that is because the routines are actually implemented in a
> library. You'll have to poke around and see what libraries are available.
>
> The normal libgcc.a library provided for the msp430 toolchain doesn't have
> these routines in them.
>
> eric
>
>
>   On Tue, Jan 27, 2009 at 3:24 PM, BAI LI <[email protected]> wrote:
>
>>   HI,
>>
>> I was trying to use math.h file sitting in the MSP folder to run some sqrt
>> and pow functions. But once I include the file math.h it told me undefined
>> reference to sqrt and pow. The errors shown in the following:
>>
>> $ make telosb
>> mkdir -p build/telosb
>>     compiling TestAesAppC to a telosb binary
>> ncc -o build/telosb/main.exe  -Os -O -mdisable-hwmul -Wall -Wshadow
>> -Wnesc-all -
>> target=telosb -fnesc-cfile=build/telosb/app.c -board=
>> -DDEFINED_TOS_AM_GROUP=0x2
>> 2 -DIDENT_APPNAME=\"TestAesAppC\" -DIDENT_USERNAME=\"EIT\"
>> -DIDENT_HOSTNAME=\"ws
>> n\" -DIDENT_USERHASH=0xa200ffadL -DIDENT_TIMESTAMP=0x497fa030L
>> -DIDENT_UIDHASH=0
>> xb441b921L -I/opt/tinyos-2.x/tos/lib/printf  TestAesAppC.nc -lm
>> /opt/tinyos-2.x/tos/chips/cc2420/lpl/DummyLplC.nc:39:2: warning: #warning
>> "*** L
>> OW POWER COMMUNICATIONS DISABLED ***"
>> /cygdrive/c/DOCUME~1/EIT/LOCALS~1/Temp/cc7jt2Gp.o: In function
>> `VirtualizeTimerC
>> $0$fireTimers':
>> app.c:(.text+0x1494): undefined reference to `pow'
>> make: *** [exe0] Error 1
>>
>> So can anyone help me out? I searched the list. Sum1 said to use lm to
>> link the math library. How to do it properly? Like make telosb lm? It didnt'
>> work. Thanks in advance.
>>
>> Regards,
>> Bai
>>
>> _______________________________________________
>> Tinyos-help mailing list
>> [email protected]
>> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>>
>
>
>
> --
> Eric B. Decker
> Senior (over 50 :-) Researcher
> Autonomous Systems Lab
> Jack Baskin School of Engineering
> UCSC
>
>
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to