编译错误:undefined reference to
头文件包含关系出了问题 undefined reference to
例如:
头文sty中声明u8 sty()用到了stm32f10x.h头文件的声明typedef xxx u8,将头文件stm32f10x.h包含添加到sty.h即可。
sty.h
u8 sty(void);
sty.c
#include "stm32f10x.h"
u8 sty(){__NOP;}
改为:
sty.h
#include "stm32f10x.h"
u8 sty(void);
sty.c
u8 sty(){__NOP;}