本帖最后由 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()函数呢?
|