From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4888 invoked by alias); 16 Jan 2007 13:33:30 -0000 Received: (qmail 4878 invoked by uid 22791); 16 Jan 2007 13:33:29 -0000 X-Spam-Check-By: sourceware.org Received: from sta-204-188-98-27.rockynet.com (HELO hermes.chez-thomas.org) (204.188.98.27) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 16 Jan 2007 13:33:19 +0000 Received: by hermes.chez-thomas.org (Postfix, from userid 999) id D5D72195021C; Tue, 16 Jan 2007 06:33:16 -0700 (MST) Received: from [192.168.1.101] (hermes_local [192.168.1.101]) by hermes.chez-thomas.org (Postfix) with ESMTP id E6F7019500A1; Tue, 16 Jan 2007 06:33:09 -0700 (MST) Message-ID: <45ACD414.2050204@mlbassoc.com> Date: Tue, 16 Jan 2007 13:33:00 -0000 From: Gary Thomas User-Agent: Thunderbird 1.5.0.8 (X11/20061107) MIME-Version: 1.0 To: Guillaume Menant CC: ecos-discuss@sources.redhat.com References: <003b01c73949$e6754770$7001a8c0@be.local> In-Reply-To: <003b01c73949$e6754770$7001a8c0@be.local> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Subject: Re: [ECOS] Using RedBoot_cmd X-SW-Source: 2007-01/txt/msg00088.txt.bz2 Guillaume Menant wrote: > Hi, > > I'm trying to add a command to RedBoot with inserting the following code in > a file names pci.c placed in the src of redboot package: > > ----------------------------------------- > #include > > void > do_pcitest(int argc, char *argv[]); > > RedBoot_cmd("pcitest", > "Tests PCI block", > "", > do_pcitest > ); > > void > do_pcitest(int argc, char *argv[]) > { > } > ----------------------------------------- > > But I'm facing to this when I'm trying to compile: > > ----------------------------------------- > sparc-rtems-gcc -msoft-float -g -nostdlib -Wl,--gc-sections -Wl,-static > -L/ecos-f/TEMP/untitled_install/lib -Ttarget.ld -o > /ecos-f/TEMP/untitled_install/bin/redboot.elf > /ecos-f/TEMP/untitled_install/lib/version.o > make[1]: Leaving directory `/ecos-f/TEMP/untitled_build/redboot/v2_0' > /ecos-f/TEMP/untitled_install/lib/extras.o(.ecos.table.RedBoot_commands.data > .do_pcitest+0xc): undefined reference to `do_pcitest' > make: Leaving directory `/ecos-f/TEMP/untitled_build' > collect2: ld returned 1 exit status > make[1]: *** [/ecos-f/TEMP/untitled_install/bin/redboot.elf] Error 1 > make: *** [build] Error 2 > ----------------------------------------- > > Why my do_pcitest function is undefined? Leave out the declaration of the function - the RedBoot_cmd() macro will declare it as static. I think this is what's causing the confusion. -- ------------------------------------------------------------ Gary Thomas | Consulting for the MLB Associates | Embedded world ------------------------------------------------------------ -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss