This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: compile
- From: llewelly at xmission dot com
- To: "frostflare" <frostflare at bol dot com dot br>
- Cc: "gcc-help" <gcc-help at gcc dot gnu dot org>
- Date: 30 Mar 2004 08:38:40 -0700
- Subject: Re: compile
- References: <HVE6AM$21A775EE1502AD2B910DC6F7C276569A@bol.com.br>
"frostflare" <frostflare@bol.com.br> writes:
> 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'
io.h? Where does that come from?
The errors you pasted mention io.h repeatedly, but the code example
you pasted does not mention io.h anywhere. So it is impossible to
get these errors with the code you pasted - I think you have left
out something important.
Errors like those you pasted usually mean there is some mistake in the
code just before the #include which #includes the header.
[snip]
> 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@gmx.de
> 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 */
> }
> }