From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6339 invoked by alias); 20 Nov 2003 22:09:45 -0000 Mailing-List: contact ecos-discuss-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@sources.redhat.com Received: (qmail 6332 invoked from network); 20 Nov 2003 22:09:44 -0000 Received: from unknown (HELO hermes.chez-thomas.org) (63.225.98.241) by sources.redhat.com with SMTP; 20 Nov 2003 22:09:44 -0000 Received: by hermes.chez-thomas.org (Postfix, from userid 2000) id 25F3A50D8D3; Thu, 20 Nov 2003 15:09:44 -0700 (MST) Received: from localhost (localhost.localdomain [127.0.0.1]) by hermes.chez-thomas.org (Postfix) with ESMTP id 6483B50D8B8; Thu, 20 Nov 2003 15:09:42 -0700 (MST) From: Gary Thomas To: Yusuke MATSUOKA Cc: ecos-discuss@sources.redhat.com In-Reply-To: <001001c3afaf$e017f570$99596180@worldcup> References: <001001c3afaf$e017f570$99596180@worldcup> Content-Type: text/plain Organization: MLB Associates Message-Id: <1069366181.1961.665.camel@hermes> Mime-Version: 1.0 Date: Thu, 20 Nov 2003 22:09:00 -0000 Content-Transfer-Encoding: 7bit X-Spam-Status: No, hits=-4.4 required=5.0 tests=AWL,EMAIL_ATTRIBUTION,IN_REP_TO,QUOTED_EMAIL_TEXT, REFERENCES,REPLY_WITH_QUOTES,USER_AGENT_XIMIAN autolearn=ham version=2.55 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) Subject: Re: [ECOS] how to link "gettimeofday" with arm-elf-gcc? X-SW-Source: 2003-11/txt/msg00284.txt.bz2 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 > #include > > 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 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