求教mplab_ide

2019-03-25 19:29发布

我写了一段程序,如下:
#include <pic.h>

unsigned char led[10]={  
                             0x3F,/*0*/
                         0x06,/*1*/
                         0x5B,/*2*/
                         0x4F,/*3*/
                         0x66,/*4*/
                         0x6D,/*5*/
                         0x7D,/*6*/
                         0x07,/*7*/
                         0x7F,/*8*/
                         0x6F,/*9*/
                      };
unsigned char led_bit[4];
int i=0;

TRISA=0;
TRISB=1;
TRISC=0;
TRISD=0;
TRISE=0;
LCDCON=0;


void delay(unsigned int K)
{
   unsigned int d;
   for(d=0;d<K;d++)
   {}
}

void main(void)
{
   PORTB=0;
   PORTD=0;
   PORTC=0;
   delay(1000);
}


结果:
Warning [374] F:MPLAB917917.c; 18.6 missing basic type; int assumed
Error   [984] F:MPLAB917917.c; 18.6 type redeclared
Error   [1098] F:MPLAB917917.c; 18.6 conflicting declarations for variable "TRISA" (C:Program FilesHI-TECH SoftwarePICC9.70includepic16f91x.h:56)
Warning [374] F:MPLAB917917.c; 19.6 missing basic type; int assumed
Error   [984] F:MPLAB917917.c; 19.6 type redeclared
Error   [1098] F:MPLAB917917.c; 19.6 conflicting declarations for variable "TRISB" (C:Program FilesHI-TECH SoftwarePICC9.70includepic16f91x.h:57)
Warning [374] F:MPLAB917917.c; 20.6 missing basic type; int assumed
Error   [984] F:MPLAB917917.c; 20.6 type redeclared
Error   [1098] F:MPLAB917917.c; 20.6 conflicting declarations for variable "TRISC" (C:Program FilesHI-TECH SoftwarePICC9.70includepic16f91x.h:58)
Warning [374] F:MPLAB917917.c; 21.6 missing basic type; int assumed
Error   [984] F:MPLAB917917.c; 21.6 type redeclared
Error   [1098] F:MPLAB917917.c; 21.6 conflicting declarations for variable "TRISD" (C:Program FilesHI-TECH SoftwarePICC9.70includepic16f91x.h:60)
Warning [374] F:MPLAB917917.c; 22.6 missing basic type; int assumed
Error   [984] F:MPLAB917917.c; 22.6 type redeclared
Error   [1098] F:MPLAB917917.c; 22.6 conflicting declarations for variable "TRISE" (C:Program FilesHI-TECH SoftwarePICC9.70includepic16f91x.h:62)
Warning [374] F:MPLAB917917.c; 23.7 missing basic type; int assumed
Error   [984] F:MPLAB917917.c; 23.7 type redeclared
Error   [1098] F:MPLAB917917.c; 23.7 conflicting declarations for variable "LCDCON" (C:Program FilesHI-TECH SoftwarePICC9.70includepic16f91x.h:82)

********** Build failed! **********
我直接晕倒!
哪位大侠给解释一下错误和警告,越详细越好,在下感激不尽!!!!!!!!!!!
其实错误就是三类:
Warning                      missing basic type; int assumed
Error                            type redeclared
Error                            conflicting declarations for variable "TRISx"
请大侠们给讲一讲啊!
此帖出自小平头技术问答
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。