回 帖 发 新 帖 刷新版面

主题:刚开始用C51出错了,请教大虾

#include <reg52.h>          //包含文件
 #include <stdio.h>
 void main(void)           //主函数
 {    
  SCON=0x52;
  TMOD=0x20;
  TH1=0xf3;
  TR1=1;               //此行及以上3行为PRINTF函数所必须
  printf("Hello I am KEIL. \n");   //打印程序执行的信息
  printf("I will be your friend.\n");
  while(1);
 } 


Build target 'Target 1'
compiling Text1.c...
C:\KEIL\C51\INC\REG52.H(1): error C100: unprintable character 0xA1 skipped
C:\KEIL\C51\INC\REG52.H(1): error C100: unprintable character 0xA1 skipped
C:\KEIL\C51\INC\REG52.H(1): error C100: unprintable character 0xA1 skipped
C:\KEIL\C51\INC\REG52.H(1): error C100: unprintable character 0xA1 skipped
C:\KEIL\C51\INC\REG52.H(1): error C100: unprintable character 0xA1 skipped
C:\KEIL\C51\INC\REG52.H(1): error C100: unprintable character 0xA1 skipped
C:\KEIL\C51\INC\REG52.H(1): error C100: unprintable character 0xA1 skipped
C:\KEIL\C51\INC\REG52.H(1): error C100: unprintable character 0xA1 skipped
C:\KEIL\C51\INC\REG52.H(1): error C100: unprintable character 0xA1 skipped
C:\KEIL\C51\INC\REG52.H(1): error C100: unprintable character 0xA1 skipped
C:\KEIL\C51\INC\REG52.H(1): error C100: unprintable character 0xA1 skipped
C:\KEIL\C51\INC\REG52.H(1): error C100: unprintable character 0xA1 skipped
C:\KEIL\C51\INC\REG52.H(1): error C100: unprintable character 0xA1 skipped
C:\KEIL\C51\INC\REG52.H(1): error C100: unprintable character 0xA1 skipped
C:\KEIL\C51\INC\REG52.H(1): error C100: unprintable character 0xA1 skipped
C:\KEIL\C51\INC\REG52.H(1): error C100: unprintable character 0xA1 skipped
C:\KEIL\C51\INC\REG52.H(1): error C100: unprintable character 0xA1 skipped
C:\KEIL\C51\INC\REG52.H(1): error C100: unprintable character 0xA1 skipped
C:\KEIL\C51\INC\REG52.H(2): error C100: unprintable character 0xA1 skipped
C:\KEIL\C51\INC\REG52.H(2): error C100: unprintable character 0xA1 skipped
C:\KEIL\C51\INC\REG52.H(2): error C141: syntax error near '#'
C:\KEIL\C51\INC\REG52.H(2): error C129: missing ';' before '<'
Target not created

回复列表 (共1个回复)

沙发


在#include后<>前不要有空格

我来回复

您尚未登录,请登录后再回复。点此登录或注册