1.报错内容1
Key6\Key6.axf: Error: L6200E: Symbol MX_GPIO_Init multiply defined (by freertos.o and gpio.o).
Key6\Key6.axf: Error: L6200E: Symbol led multiply defined (by freertos.o and gpio.o).
Key6\Key6.axf: Error: L6200E: Symbol HAL_GPIO_EXTI_Callback multiply defined (by freertos.o and gpio.o).
Not enough information to list image symbols.
Not enough information to list the image map.
Finished: 2 information, 0 warning and 3 error messages.
"Key6\Key6.axf" - 3 Error(s), 0 Warning(s).
分析原因:
频繁提到了.o文件,出现了multiply defined(多重定义),那么就应该想到相互调用导致的多次定义。
解决方法:
1.导入头文件使用#include“xxxx.h”,注意使用的是.h的文件,不是c文件
2.定义的数据放入头文件中,不要在.c文件中
例如:以下改为.h(把数据定义放入.h文件)
2.报错内容
Key6\Key6.axf: Error: L6200E: Symbol led multiply defined (by gpio.o and main.o).
Key6\Key6.axf: Error: L6200E: Symbol led multiply defined (by freertos.o and main.o).
Not enough information to list image symbols.
Not enough information to list the image map.
Finished: 2 information, 0 warning and 2 error messages.
"Key6\Key6.axf" - 2 Error(s), 0 Warning(s).
本质上与上述一样,都是数据定义的地方出错,定义到.h文件中,并且导入头文件为.h文件即可。