RE: compile

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



DDRB and PORTB
are not declared indeed.
You have to declare them first.
BTW, what was you command line?
----
Lev Assinovsky
Aelita Software Corporation 
(now is a part of Quest Software)
O&S InTrust Framework Division, Team Leader
ICQ# 165072909


> -----Original Message-----
> From: frostflare [mailto:frostflare@xxxxxxxxxx]
> Sent: Tuesday, March 30, 2004 5:47 PM
> To: gcc-help
> Subject: compile
> 
> 
> I have a C program to use leds at AT91EB40A board, 
> using gcc on cygwin. But i can'compile the program.
> It show this big message.
> 
> 
> In file included 
> from /home/admin/gcctest/gcctest1/gcctest1.c:17:
> /usr/local/arm/lib/gcc-lib/arm-
> elf/2.95.3/include/io.h:29: syntax error before `
> extern'
> /usr/local/arm/lib/gcc-lib/arm-
> elf/2.95.3/include/io.h:30: parse error before `_
> _THROW'
> /usr/local/arm/lib/gcc-lib/arm-
> elf/2.95.3/include/io.h:30: warning: data definit
> ion has no type or storage class
> 
> /usr/local/arm/lib/gcc-lib/arm-
> elf/2.95.3/include/io.h:35: parse error before `_
> _THROW'
> /usr/local/arm/lib/gcc-lib/arm-
> elf/2.95.3/include/io.h:35: warning: data definit
> ion has no type or storage class
> /usr/local/arm/lib/gcc-lib/arm-
> elf/2.95.3/include/io.h:38: parse error before `_
> _THROW'
> /usr/local/arm/lib/gcc-lib/arm-
> elf/2.95.3/include/io.h:38: warning: data definit
> ion has no type or storage class
> /usr/local/arm/lib/gcc-lib/arm-
> elf/2.95.3/include/io.h:39: parse error before `_
> _THROW'
> /usr/local/arm/lib/gcc-lib/arm-
> elf/2.95.3/include/io.h:39: warning: data definit
> ion has no type or storage class
> /usr/local/arm/lib/gcc-lib/arm-
> elf/2.95.3/include/io.h:40: parse error before `_
> _THROW'
> /usr/local/arm/lib/gcc-lib/arm-
> elf/2.95.3/include/io.h:40: warning: data definit
> ion has no type or storage class
> /usr/local/arm/lib/gcc-lib/arm-
> 
> elf/2.95.3/include/io.h:42: parse error before `_
> _THROW'
> /usr/local/arm/lib/gcc-lib/arm-
> elf/2.95.3/include/io.h:42: warning: data definit
> ion has no type or storage class
> /usr/local/arm/lib/gcc-lib/arm-
> elf/2.95.3/include/io.h:43: parse error before `_
> _THROW'
> /usr/local/arm/lib/gcc-lib/arm-
> elf/2.95.3/include/io.h:43: warning: data definit
> ion has no type or storage class
> /usr/local/arm/lib/gcc-lib/arm-
> elf/2.95.3/include/io.h:44: parse error before `_
> _THROW'
> /usr/local/arm/lib/gcc-lib/arm-
> elf/2.95.3/include/io.h:44: warning: data definit
> ion has no type or storage class
> /home/admin/gcctest/gcctest1/gcctest1.c:18: syntax 
> error before `typedef'
> /home/admin/gcctest/gcctest1/gcctest1.c: In function 
> `main':
> /home/admin/gcctest/gcctest1/gcctest1.c:24: `DDRB' 
> undeclared (first use in this
>  function)
> /home/admin/gcctest/gcctest1/gcctest1.c:24: (Each 
> undeclared identifier is repor
> ted only once
> /home/admin/gcctest/gcctest1/gcctest1.c:24: for each 
> function it appears in.)
> /home/admin/gcctest/gcctest1/gcctest1.c:29: `PORTB' 
> undeclared (first use in thi
> s function)
> /home/admin/gcctest/gcctest1/gcctest1.c:38: parse error 
> before `{'
> 
> 
> This the program:
> 
> /*
>     Title:    AVR-GCC test program #1 for the STK200 
> eva board
>     Author:   Volker Oth
>     Date:     4/1999
>     Purpose:  Flashes the LEDs on Port B with a hard 
> coded delay loop
>     needed
>     Software: AVR-GCC
>     needed
>     Hardware: ATS90S8515/8535/2313/mega on 
> STK200/STK300 board
>     Note:     To contact me, mail to
>                   volkeroth@xxxxxx
>               You might find more AVR related stuff at 
> my homepage:
>                   http://members.xoom.com/volkeroth
> */
> 
> 
> 
> typedef unsigned char  u08;
> 
> 
> int main( void )
> {
>    u08 led, i, j, k;
> 
>    outp(0xff,DDRB);            /* use all pins on PortB 
> for output */
> 
>    led = 1;                    /* init variable 
> representing the LED state */
> 
>    for (;;) {
> 
>        outp(~led, PORTB);      /* invert the output 
> since a zero means: LED on */
>        led <<= 1;              /* move to next LED */
>        if (!led)               /* overflow: start with 
> Port B0 again */
>            led = 1;
>        for (i=0; i<255; i++)   /* outer delay loop */
>            for(j=0; j<255;j++) /* inner delay loop */
>                k++;            /* just do something - 
> could also be a NOP */
>    }
> }
> 
> please can somebody help me with it?
> 
> 
> 
> 
> 
>  
> ______________________________________________________________
> ____________
> Acabe com aquelas janelinhas que pulam na sua tela.
> AntiPop-up UOL - É grátis!
> http://antipopup.uol.com.br/
> 
> 
> 


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux