【发布时间】:2016-02-17 09:25:53
【问题描述】:
在我的 avrstudio4 项目中,我遇到了这个错误:
../Indication.c:95:15: error: static declaration of 'menu_boot' follows non-static declaration
在 main.c 我输入 #include "indication.h"
indication.h 是 indication.c 的头文件,函数在其中定义如下:
unsigned char menu_boot(unsigned char index, unsigned char *menu1)
__attribute__((section(".core")));
在 indication.c 我有
#include "indication.h"
...
unsigned char menu_boot(unsigned char index, unsigned char *menu1)
我该怎么办?
【问题讨论】:
-
您的 .c 文件中的内容是否应该在签名后也没有
__attribute__((section(".core")))? -
您是否在
Indication.c和indication.c引用同一文件的系统上?你的编译错误在Indication.c,所以除非文件系统不区分大小写,否则你正在查看错误的文件。 (Mac 和 Windows 通常不区分大小写。)您的 GCC 版本是否没有告诉您之前的声明在哪里? -
@rjayavrp:x-ref 的问题当然涵盖了同样的问题。不过,答案并没有详细解释正在发生的事情。