我会用STC单片机,最近接个小项目,要用AVR(ATmega8L)设计程序。刚刚搭建好的开发环境是WinAVR AVR Studio 4,在AVRStudio4里我用汇编写个小程序调试、烧写正常。但改建一个C语言工程后,好像找不到头文件,例如网上的这个例子:
#in
我会用STC单片机,最近接个小项目,要用AVR(ATmega8L)设计程序。刚刚搭建好的开发环境是WinAVR AVR Studio 4,在AVRStudio4里我用汇编写个小程序调试、烧写正常。但改建一个C语言工程后,好像找不到头文件,例如网上的这个例子:
#include //头文件
#include //引用系统自带的延时函数
光是这两句话在编译时就会出现如下错误:
-----------------------------------------------------
Build started 11.10.2010 at 11:53:45
avr-gcc.exe -mmcu=atmega8 -Wall -gdwarf-2 -O0 -MD -MP -MT test7.o -MF dep/test7.o.d -c ../test7.c
../test7.c:2: error: stray '243' in program
../test7.c:2: error: stray '243' in program
../test7.c:2: error: expected '=', ',', ';', 'asm' or '__attribute__' before '
../test7.c:3: error: stray '243' in program
../test7.c:3: error: stray '243' in program
make: *** [test7.o] Error 1
Build failed with 5 errors and 0 warnings...
-----------------------------------------------------
我是AVR新手,请AVR高人帮我看看这是怎么回事?怎样能解决?
展开
全部