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