打印
[AVR单片机]

ICCAVR7.22不认我的putchar()函数?

[复制链接]
2576|2
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
本帖最后由 TECHWELL 于 2013-9-6 17:32 编辑

  N年前,我在WINDOWS XP下,用ICCAVR 6.31A做了一些工程。如今,用上了WIN7,
在WIN7之下,ICCAVR6.31是死活不能运行的. 只好改用ICCAVR 7.22,编译时就有了问题:
ICCAVR 7.22 不认我自己编写的int putchar(char c)函数.我已经在各C文件中#include "stdio.h".
ICCAVR 7.22报错如下:
!ERROR Function 'putchar' not defined. This is a hardware dependent function,
  and it is not included in the ICCAVR default library. Please implement
  this function to match your target requirements. You can find examples
  of this function under the <install root>\examples.AVR directory. Make
  a copy of a suitable example, add it to your project and modify it if
  needed. The source code must #include the appropriate C header file
  (e.g. stdio.h) as it contains the special compiler pragma for 'putchar'.
上边一大堆,意思就是ICCAVR7.22在连接时,找不到putchar()这个函数。
  
  
  ICCAVR7.22 的 stdio.h中的putchar()函数,是这样;
  int putchar(char);
  
  我的工程中,XX.c文件中的putchar()函数也是这样的(大小写也是一致的):
  int putchar(char c)  
   {
     ...
    return ...
   }

  这一切,显然都是对的,它为何就不认我的putchar()函数呢?
  
  

相关帖子

沙发
huangxz| | 2013-9-7 15:17 | 只看该作者
没问题啊

使用特权

评论回复
评分
参与人数 1威望 +6 收起 理由
qin552011373 + 6 很给力!
板凳
qin552011373| | 2013-9-7 23:57 | 只看该作者
上传一下你的工程看看

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

21

主题

68

帖子

5

粉丝