struct save
{
unsigned char code;
unsigned int d;
unsigned int n;
unsigned int w;
}str[50];
struct save str[50]__attribute__((section(".eeprom")));
extern struct style style_buffer;
//********************************************************************
void save(void)
{eeprom_write_block(style_buffer,str[style_buffer.code],6);}
//*******************
我这里定义的全局变量style_buffer怎么提示错误
../sxj009.c:497: error: 'style_buffer' has an incomplete type
请大哥大姐指点一下GCC编译有12个错误这个定义不了,兄弟我想diy电脑绕线机这读写eeprom时编译不过,
要是解决了请邮件asiaschain@yahoo.com.cn
不顶自己顶,这个程序这eeprom问题不解决就没啥意义:L.
Build started 12.2.2013 at 14:05:52
avr-gcc -mmcu=atmega16 -Wall -gdwarf-2 -std=gnu99 -DF_CPU=800000UL -O0 -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -MD -MP -MT type.o -MF dep/type.o.d -c ../type.c
In file included from ../type.c:2:
c:/winavr-20100110/lib/gcc/../../avr/include/util/delay.h:90:3: warning: #warning "Compiler optimizations disabled; functions from <util/delay.h> won't work as designed"
../type.c: In function 'save':
../type.c:19: warning: value computed is not used
../type.c:21: error: incompatible type for argument 2 of '__eewr_block_m16'
make: *** [type.o] Error 1
Build failed with 1 errors and 2 warnings...
Build started 12.2.2013 at 20:08:01
avr-gcc -mmcu=atmega16 -Wl,-Map=ssss.map type.o pwm.o key.o main.o lcd.o -o ssss.elf
main.o:(.eeprom+0x0): multiple definition of `save'
type.o:F:\avr\ssss\default/../type.c:19: first defined here
c:/winavr-20100110/bin/../lib/gcc/avr/4.3.3/../../../../avr/bin/ld.exe: Warning: size of symbol `save' changed from 36 in type.o to 300 in main.o
c:/winavr-20100110/bin/../lib/gcc/avr/4.3.3/../../../../avr/bin/ld.exe: Warning: type of symbol `save' changed from 2 to 1 in main.o
make: *** [ssss.elf] Error 1
Build failed with 2 errors and 0 warnings...