ts-7000
[Top] [All Lists]

Re: [ts-7000] Help with Math functions

To:
Subject: Re: [ts-7000] Help with Math functions
From: Craig and Janet Gates <>
Date: Sat, 14 Apr 2007 16:37:35 -0700
on the arm-linux-gcc line add -lm so the math library is used.

arm-linux-gcc -lm test.c -mcpu=arm9


cspin_2001 wrote:

I tried the following code snippet to test the trig functions

#include <math.h>
#include <stdio.h>

main()
{
printf("sin of 45 deg %f\n",sin(0.7853979));
printf("cosine of 45 deg %f\n",cos(0.7853979));
printf("Tangent of 45 deg %f\n",tan(0.7853979));
}

I tried to compiled it for the TS-7260 using crosstools and this is
is the messages I get.

linux-h4hb:~/Desktop/Code # /usr/local/opt/crosstool/arm-linux/gcc-
3.3.4-glibc-2.3.2/bin/arm-linux-gcc test.c -mcpu=arm9

/tmp/cce6WkFl.o(.text+0x14): In function `main':
: undefined reference to `sin'
/tmp/cce6WkFl.o(.text+0x38): In function `main':
: undefined reference to `cos'
/tmp/cce6WkFl.o(.text+0x5c): In function `main':
: undefined reference to `tan'
collect2: ld returned 1 exit status

Any ideas why the math function are not working.

Charlie


__._,_.___


SPONSORED LINKS
Single board computer Hardware Computer running slow
Linux os Single board

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: =Email Delivery: Digest | m("yahoogroups.com?subject","ts-7000-fullfeatured");=Change Delivery Format: Fully Featured">Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | =Unsubscribe

__,_._,___
<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU