为什么用keil编辑单片机流水灯程序时会提示以下错误,用c编写的,点击错误也不提示是哪的错误
这是程序:#include<reg52.h>#include<intrins.h>#defineuintunsignedint#defineucharunsignedch...
这是程序:
#include<reg52.h>
#include<intrins.h>
#define uint unsigned int
#define uchar unsigned char
uchar temp;
void delay(uint);
void main()
{
temp=0xfe;
P3=temp;
while(1)
{
temp=_crol_(temp,1);
delay(100);
P3=temp;
}
}
void delay(uint z)
{
uint x,y;
for(x=z;x>0;x--){
for(y=500;y>0;y--){
}
}
}
}
这是提示的错误:Build target 'Target 1'
assembling STARTUP.A51...
compiling lesson_1.c...
compiling lesson2.c...
linking...
*** ERROR L104: MULTIPLE PUBLIC DEFINITIONS
SYMBOL: _DELAY
MODULE: lesson2.obj (LESSON2)
*** ERROR L104: MULTIPLE PUBLIC DEFINITIONS
SYMBOL: MAIN
MODULE: lesson2.obj (LESSON2)
*** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS
SEGMENT: ?PR?MAIN?LESSON2
Program Size: data=10.0 xdata=0 code=126
Target not created 展开
#include<reg52.h>
#include<intrins.h>
#define uint unsigned int
#define uchar unsigned char
uchar temp;
void delay(uint);
void main()
{
temp=0xfe;
P3=temp;
while(1)
{
temp=_crol_(temp,1);
delay(100);
P3=temp;
}
}
void delay(uint z)
{
uint x,y;
for(x=z;x>0;x--){
for(y=500;y>0;y--){
}
}
}
}
这是提示的错误:Build target 'Target 1'
assembling STARTUP.A51...
compiling lesson_1.c...
compiling lesson2.c...
linking...
*** ERROR L104: MULTIPLE PUBLIC DEFINITIONS
SYMBOL: _DELAY
MODULE: lesson2.obj (LESSON2)
*** ERROR L104: MULTIPLE PUBLIC DEFINITIONS
SYMBOL: MAIN
MODULE: lesson2.obj (LESSON2)
*** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS
SEGMENT: ?PR?MAIN?LESSON2
Program Size: data=10.0 xdata=0 code=126
Target not created 展开
3个回答
展开全部
#include<reg52.h> // 试试
#include<intrins.h>
#define uint unsigned int
#define uchar unsigned char
uchar temp;
void delay(uint);
void main()
{
temp=0xfe;
P3=temp;
while(1)
{
temp=_crol_(temp,1);
delay(100);
P3=temp;
}
}
void delay(uint z)
{
uint x,y;
for(x=z;x>0;x--)
{
for(y=500;y>0;y--)
{}
}
}
#include<intrins.h>
#define uint unsigned int
#define uchar unsigned char
uchar temp;
void delay(uint);
void main()
{
temp=0xfe;
P3=temp;
while(1)
{
temp=_crol_(temp,1);
delay(100);
P3=temp;
}
}
void delay(uint z)
{
uint x,y;
for(x=z;x>0;x--)
{
for(y=500;y>0;y--)
{}
}
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
你在学51单片机? 我也正在学 有机会 讨论一下
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询