我正面临着一个链接器错误:
.\STM32F4xx-Nucleo\DMA_LP_App.axf: Error: L6218E: Undefined symbol HAL_UART_Init (referred from main.o).
我已经在option -> C/C++ -> include path
中添加了文件stm32f4xx_hal_uart.c
及其路径,但它仍然显示错误。
我已经通过RTE管理器添加了该文件,但仍然出现相同的错误。
如果我添加该文件两次,它会显示:
.\STM32F4xx-Nucleo\DMA_LP_App.axf: Error: L6200E: Symbol __asm___20_stm32f4xx_hal_uart_c____REV16 multiply defined (by stm32f4xx_hal_uart_1.o and stm32f4xx_hal_uart.o).
请告诉我是什么导致了这个问题,以及可能的解决方案。
发布于 2017-03-08 00:15:07
已通过使用定义在项目的stm32f4xx_hal_conf.h
文件中启用模块修复此问题。
发布于 2019-05-14 22:13:48
当我将一个.c
文件移动到C++项目时,我也遇到了同样的问题。为了解决这个问题,我必须添加以下几行:
#include "abcxyz.h" //etc
#ifdef __cplusplus
extern "C" {
#endif
/* Contents of your source file */
#ifdef __cplusplus
}
#endif
https://stackoverflow.com/questions/42650318
复制相似问题