From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24028 invoked by alias); 20 Nov 2003 21:47:27 -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 24021 invoked from network); 20 Nov 2003 21:47:26 -0000 Received: from unknown (HELO whittier.seas.ucla.edu) (164.67.100.80) by sources.redhat.com with SMTP; 20 Nov 2003 21:47:26 -0000 Received: (from root@localhost) by whittier.seas.ucla.edu (8.8.8/8.8.8(seas-smtp30-0004)) id NAA03071 for ecos-discuss@sources.redhat.com; Thu, 20 Nov 2003 13:47:25 -0800 (PST) Received: from ohm.ee.ucla.edu (ohm.ee.ucla.edu [128.97.88.186]) by whittier.seas.ucla.edu (8.8.8/8.8.8(seasall)-prefilter-003) with ESMTP id NAA03027 for ; Thu, 20 Nov 2003 13:47:22 -0800 (PST) Received: from worldcup (Worldcup.ee.ucla.edu [128.97.89.153]) by ohm.ee.ucla.edu (8.8.8/8.8.8(ee0003-outscan-04)) with ESMTP id NAA25116 for ; Thu, 20 Nov 2003 13:47:22 -0800 (PST) From: "Yusuke MATSUOKA" To: Date: Thu, 20 Nov 2003 21:47:00 -0000 Message-ID: <001001c3afaf$e017f570$99596180@worldcup> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 In-Reply-To: <20031120184437.GB2130@lunn.ch> X-Virus-Scanned: by AMaViS Sophie/Sophos Subject: [ECOS] how to link "gettimeofday" with arm-elf-gcc? X-SW-Source: 2003-11/txt/msg00282.txt.bz2 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? Thanks, Yusuke -- Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos and search the list archive: http://sources.redhat.com/ml/ecos-discuss