【问题描述】

uart.c文件中有函数read_sample的实现:

[plain] view plain copy
 print?
  1. static void delay(void)  
  2. {  
  3.        //statement  
  4. }  
uart.h文件中有函数delay的声明:
[plain] view plain copy
 print?
  1. static void delay(void);  
程序编译的时候会报错:
warning: 'delay' defined but not never defined
【问题原因】
声明为static的函数不能被其他文件所使用,如果其他文件include uart.h。那么就会报上面的错误。
【解决办法】

解决的办法很简单,将头文件中的声明转移到.c文件中就可以了,即将函数delay的声明从uart.h移动到uart.c文件的开始就可以了。


转自:http://blog.csdn.net/ce123/article/details/8186826

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-02-15
  • 2021-10-08
  • 2021-09-20
  • 2022-12-23
  • 2021-05-25
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-09
相关资源
相似解决方案