标题: *** ERROR L104: MULTIPLE PUBLIC DEFINITIONS无法生成hex文件 [打印本页]

作者: 1019aywh    时间: 2020-5-13 09:04
标题: *** ERROR L104: MULTIPLE PUBLIC DEFINITIONS无法生成hex文件
#include <reg51.h>                     
#define SEG P2                                       
#define SCAN P3                              

#define uchar unsigned char
#define uint  unsigned int

uchar shu[] = {0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf9,0x80,0xc0,0xb0,0xc0,0xf8,0xc0,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff};//18030708

uchar seg[10] = {0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90};

uchar sel[8] = {0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f};      
unsigned char count=0;
unsigned int y,m;
void Timer0Interrupt(void) interrupt 1
{
    TH0 = 0x3C;
    TL0 = 0x0B0;
    count++;

}

void delay_1ms(uint x)              
{
        uint i,j;

        for(i=0; i<x; i++)
           for(j=0; j<120; j++);
}

void InitTimer0(void)
{
    TMOD = 0x01;
    TH0 = 0x3C;
    TL0 = 0x0B0;
    EA = 1;
    ET0 = 1;
    TR0 = 1;
   while(1)
  {
               for(m=0;m<8;m++)
            {      
                SCAN = ~0xff;                 
                SEG = shu[y+m];                       
                SCAN = ~sel[m];            
                delay_1ms(1);  
               }  
if(count==20){count=0;break;}}
}




void main(void)
{


      while(1)                                          
         {   
           for(y=0;y<15;y++)
         {   

        InitTimer0();
       }
      }}

作者: 1019aywh    时间: 2020-5-13 09:43
就是出现了这个*** ERROR L104: MULTIPLE PUBLIC DEFINITIONS
作者: wulin    时间: 2020-5-13 10:14


作者: man1234567    时间: 2020-5-13 11:49
Keil 5 表示生成无压力。ERROR L104: MULTIPLE PUBLIC DEFINITIONS可能是低版本的没处理好变量以为是有重复定义,如果坚持在低版本上生成可将似是而非的不同之处搞大点而不仅在大小写。
作者: 既然青春留不住    时间: 2020-5-13 13:11
用Keil 4编译没有错误啊




欢迎光临 (http://www.51hei.com/bbs/) Powered by Discuz! X3.1