missing function-prototype
单片机程序,引用DelayMs,
while (1) {
//ShellMain();
printf("hello world\r\n");
DelayMs(1000);
}
报错,
Build target 'Target 1'
compiling main.c...
..\src\main.c(26): warning C206: 'DelayUs': missing function-prototype
..\src\main.c(26): error C267: 'DelayUs': requires ANSI-style prototype
Target not created
明明已经实现了这个函数,后来发现是头文件的预编译宏和另外一个文件重复,
#ifndef __PCA_H_
#define __PCA_H_
void DelayUs(unsigned long us);
void DelayMs(unsigned long ms);
#endif
更改为,
#ifndef __DELAY_H_
#define __DELAY_H_
void DelayUs(unsigned long us);
void DelayMs(unsigned long ms);
#endif