- Код: Выделить всё • Развернуть
#include <mega8.h>
#include <delay.h>
void main(void)
{
DDRB=0b00000001;
while(1)
{
PORTB.0=1;
delay_ms(500);
PORTB.0=0;
delay_ms(500);
}
}
roboforum.ruТехнический форум по робототехнике. |
|
|
#include <mega8.h>
#include <delay.h>
void main(void)
{
DDRB=0b00000001;
while(1)
{
PORTB.0=1;
delay_ms(500);
PORTB.0=0;
delay_ms(500);
}
}
#include <C:\WinAVR\mega8.h>
#include <C:\WinAVR\delay.h>
void main(void)
{
DDRB=0b00000001;
while(1)
{
PORTB.0=1;
delay_ms(500);
PORTB.0=0;
delay_ms(500);
}
}
Build started 14.3.2010 at 17:36:08
avr-gcc -mmcu=atmega8 -Wall -gdwarf-2 -Os -std=gnu99 -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -MD -MP -MT 2.o -MF dep/2.o.d -c ../2.c
In file included from ../2.c:1:
C:\WinAVR\mega8.h:9: warning: ignoring #pragma used
C:\WinAVR\mega8.h:10: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'TWBR'
C:\WinAVR\mega8.h:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'TWSR'
C:\WinAVR\mega8.h:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'TWAR'
...
C:\WinAVR\mega8.h:77: warning: ignoring #pragma used
In file included from ../2.c:1:
C:\WinAVR\mega8.h:106:2: error: invalid preprocessing directive #asm
C:\WinAVR\mega8.h:109: error: expected identifier or '(' before '.' token
C:\WinAVR\mega8.h:118:2: error: invalid preprocessing directive #endasm
In file included from ../2.c:2:
C:\WinAVR\delay.h:7: warning: ignoring #pragma used
C:\WinAVR\delay.h:12: warning: ignoring #pragma used
../2.c:3: warning: return type of 'main' is not 'int'
../2.c: In function 'main':
../2.c:5: error: 'DDRB' undeclared (first use in this function)
../2.c:5: error: (Each undeclared identifier is reported only once
../2.c:5: error: for each function it appears in.)
../2.c:8: error: 'PORTB' undeclared (first use in this function)
../2.c:8: error: expected ';' before numeric constant
../2.c:10: error: expected ';' before numeric constant
make: *** [2.o] Error 1
Build failed with 76 errors and 5 warnings...
#include "mega8.h"
#include "delay.h"
../2.c:1:19: error: mega8.h: No such file or directory
../2.c:2:19: error: delay.h: No such file or directory
...
#include "C:\WinAVR\mega8.h"
#include "C:\WinAVR\delay.h"
avr-gcc -mmcu=atmega8 -Wall -gdwarf-2 -Os -std=gnu99 -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -MD -MP -MT 2.o -MF dep/2.o.d -c ../2.c
In file included from ../2.c:1:
C:\WinAVR\mega8.h:9: warning: ignoring #pragma used
C:\WinAVR\mega8.h:10: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'TWBR'
C:\WinAVR\mega8.h:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'TWSR'
...
C:\WinAVR\mega8.h:77: warning: ignoring #pragma used
In file included from ../2.c:1:
C:\WinAVR\mega8.h:106:2: error: invalid preprocessing directive #asm
C:\WinAVR\mega8.h:109: error: expected identifier or '(' before '.' token
C:\WinAVR\mega8.h:118:2: error: invalid preprocessing directive #endasm
In file included from ../2.c:2:
C:\WinAVR\delay.h:7: warning: ignoring #pragma used
C:\WinAVR\delay.h:12: warning: ignoring #pragma used
../2.c:3: warning: return type of 'main' is not 'int'
../2.c: In function 'main':
../2.c:5: error: 'DDRB' undeclared (first use in this function)
../2.c:5: error: (Each undeclared identifier is reported only once
../2.c:5: error: for each function it appears in.)
../2.c:8: error: 'PORTB' undeclared (first use in this function)
../2.c:8: error: expected ';' before numeric constant
../2.c:10: error: expected ';' before numeric constant
make: *** [2.o] Error 1
Build failed with 76 errors and 5 warnings...
блин а я думал об этом, ессно свои инклуды у винАВР
где тогда его искать?
GrayHunter писал(а):расскажите точную последовательность действий, чтобы скомпилить код в CodeVisionAVR C Compiler.
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 21