From: Gary Thomas <gary@mlbassoc.com>
To: Yusuke MATSUOKA <yusuke@ee.ucla.edu>
Cc: ecos-discuss@sources.redhat.com
Subject: Re: [ECOS] how to link "gettimeofday" with arm-elf-gcc?
Date: Thu, 20 Nov 2003 22:09:00 -0000 [thread overview]
Message-ID: <1069366181.1961.665.camel@hermes> (raw)
In-Reply-To: <001001c3afaf$e017f570$99596180@worldcup>
On Thu, 2003-11-20 at 14:47, Yusuke MATSUOKA wrote:
> Hi all,
> I just wanna know how to link gettimeofday with arm-elf-gcc.
>
> I'm trying to compile a simple program on Cygwin,
> with arm-elf-gcc which is downloaded and installed via ecos-install.tcl
> provided at ecos site.
>
> I think I have built libraries for SA1110 successfuly, such as:
> bash-2.05b$ pwd
> /home/yusuke/SA1110_new/sa1110_install/lib
> bash-2.05b$ ll
> total 8974
> drwxrwxrwx+ 2 yusuke None 0 Nov 19 15:17 ./
> drwxrwxrwx+ 5 yusuke None 0 Oct 23 15:43 ../
> -rw-rw-rw- 1 yusuke None 390748 Oct 23 15:32 extras.o
> -rw-rw-rw- 1 yusuke None 402954 Oct 23 15:32 libextras.a
> -rw-rw-rw- 1 yusuke None 8381312 Oct 23 15:32 libtarget.a
> -rw-rw-rw- 1 yusuke None 2156 Oct 23 15:32 target.ld
> -rw-rw-rw- 1 yusuke None 9236 Oct 23 15:32 vectors.o
>
> However, when I compile as follows,
> arm-elf-gcc.exe -g -I/home/yusuke/SA1110_new/sa1110_install/include \
> -L/opt/ecos/gnutools/arm-elf/lib/gcc-lib/arm-elf/3.2.1 \
> -L/home/yusuke/SA1110_new/sa1110_install/lib -Ttarget.ld \
> -nostdlib hello.c
>
>
> I got an error that linker cannot find "gettimeofday" as follows:
> bash-2.05b$ make.csh
> /ecos-c/DOCUME~1/yusuke/LOCALS~1/Temp/ccgyG7X0.o: In function `main':
> /home/yusuke/SA1110_new/Hello/hello.c:12: undefined reference to
> `gettimeofday'
> collect2: ld returned 1 exit status
>
>
> My code is quite simple:
> #include<stdio.h>
> #include <sys/time.h>
>
> int main()
> {
> printf ("\n");
> printf (" Hello World !!\n");
> printf (" You are running this on the SA-1110\n");
> printf ("\n");
>
> struct timeval tv;
> gettimeofday(&tv, NULL) ;
> printf("%ld %ld\n", tv.tv_sec, tv.tv_usec);
>
> return (0);
> }
>
>
> Can anybody help me, please?
>
The 'gettimeofday()' function is not normally available in eCos,
because few platforms which run eCos have any notion of absolute time.
Besides the obvious (printing a time/date in your example), why
do you need it?
--
Gary Thomas <gary@mlbassoc.com>
MLB Associates
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss
prev parent reply other threads:[~2003-11-20 22:09 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-11-20 17:52 [ECOS] Sending Raw Ethernet packets (ether_output, ether_output_frame, __enet_send ?) kevin_lemay
2003-11-20 18:44 ` Andrew Lunn
2003-11-20 21:47 ` [ECOS] how to link "gettimeofday" with arm-elf-gcc? Yusuke MATSUOKA
2003-11-20 22:06 ` Andrew Lunn
2003-11-20 22:34 ` Yusuke Matsuoka
2003-11-20 22:38 ` Gary Thomas
2003-11-20 22:40 ` Andrew Lunn
2003-11-20 22:09 ` Gary Thomas [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1069366181.1961.665.camel@hermes \
--to=gary@mlbassoc.com \
--cc=ecos-discuss@sources.redhat.com \
--cc=yusuke@ee.ucla.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).