|
求助,maplab ide 下mcc编译怎么不能声明int型变量啊?
[复制链接]
早明变量就报错,这是怎么回事?
原代码:
#include
void main(void){
TRISC = 0b00000000;
PORTC = 0b00000000;
PORTCbits.RC1 = 1;
PORTCbits.RC3 = 1;
unsigned int i=0; //这里是第7行.
int a[8] = {1,2,4,8,16,32,64,128};
while(1){
PORTC = a&a[7-i];
i=++i%8;
}
}
出错提示:
----------------------------------------------------------------------
Debug build of project `E:\PICC4520\lesson2.3\8LED.mcp' started.
Preprocessor symbol `__DEBUG' is defined.
Sat Oct 24 20:31:58 2009
----------------------------------------------------------------------
Clean: Deleting intermediary and output files.
Clean: Done.
Executing: "D:\MCC18\bin\mcc18.exe" -p=18F4520 /i"D:\MCC18\h" "8LED.c" -fo="8LED.o" -D__DEBUG -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa-
MPLAB C18 v3.02 (demo)
Copyright 1999-2005 Microchip Technology Inc.
Days remaining until demo becomes feature limited: 32
E:\PICC4520\lesson2.3\8LED.c:7:Error: syntax error
Halting build on first failure as requested.
----------------------------------------------------------------------
Debug build of project `E:\PICC4520\lesson2.3\8LED.mcp' failed.
Preprocessor symbol `__DEBUG' is defined.
Sat Oct 24 20:31:59 2009
----------------------------------------------------------------------
BUILD FAILED
|
|