.\Obj\STM32_EXTInterrupt.axf: Error: L6200E: Symbol NVIC_Configuration multiply defined (by sys.o and extinterrupt.o).
这个错误是因为在你的代码中,NVIC_Configuration符号被sys.o和extinterrupt.o两个目标文件同时定义了。这通常是因为你在两个文件中都定义了相同的函数或变量。
要解决这个错误,你需要检查你的代码并确保在整个项目中,每个函数和变量只被定义了一次。如果你确定这个函数只需要在extinterrupt.c中使用,你可以在sys.c中将其声明为extern,以避免重复定义。
你可以在extinterrupt.c文件中添加以下代码来解决这个错误:
//在extinterrupt.c中添加以下代码
extern void NVIC_Configuration(void);
然后在sys.c文件中删除与NVIC_Configuration函数相关的定义,只保留函数声明:
//在sys.c中删除与NVIC_Configuration函数相关的定义,只保留函数声明
extern void NVIC_Configuration(void);
这样做会告诉编译器,该函数的定义在另一个文件中,并且只需要在extinterrupt.c中使用。这应该解决这个错误。
..\OBJ\05_class_one.axf: Error: L6200E: Symbol kp multiply defined (by pid.o and main.o). ..\OBJ\05_class_one.axf: Error: L6200E: Symbol ki multiply defined (by pid.o and main.o). ..\OBJ\05_class_one.axf: Error: L6200E: Symbol kd multiply defined (by pid.o and main.o). ..\OBJ\05_class_one.axf: Error: L6200E: Symbol error multiply defined (by pid.o and main.o). ..\OBJ\05_class_one.axf: Error: L6200E: Symbol last_error multiply defined (by pid.o and main.o). ..\OBJ\05_class_one.axf: Error: L6200E: Symbol add_error multiply defined (by pid.o and main.o). ..\OBJ\05_class_one.axf: Error: L6200E: Symbol dy_error multiply defined (by pid.o and main.o). ..\OBJ\05_class_one.axf: Error: L6200E: Symbol pid_out multiply defined (by pid.o and main.o). Not enough information to list image symbols. Not enough information to list load addresses in the image map.
这些错误是由于在 'pid.o' 和 'main.o' 文件中同时定义了 'kp'、'ki'、'kd'、'error'、'last_error'、'add_error'、'dy_error' 和 'pid_out' 这些符号导致的。这种重复定义会导致链接时的冲突。要解决这个问题,你需要确保这些符号只在一个文件中定义。你可以检查一下这些文件,看看是否有重复定义的地方,并将其中一处定义删除或修改。
..\OBJ\Tempate.axf: Error: L6200E: Symbol Font12_Table multiply defined (by font12.o and bsp_lcd.o).
在遇到..\OBJ\Tempate.axf: Error: L6200E: Symbol Font12_Table multiply defined (by font12.o and bsp_lcd.o)
这类错误时,它表明编译器检测到名为Font12_Table
的符号在font12.o
和bsp_lcd.o
这两个模块中有重复定义。这是由于你在项目中有一个Font12_Table
函数或者变量被意外地在不止一个源文件里声明了。
解决这个问题通常需要执行以下步骤[^1]:
查找重定义:首先,检查
font12.c
和bsp_lcd.c
(假设这些是对应的源文件)是否有对Font12_Table
的定义。找到它们并确认每个定义是否必要。消除冗余:如果
Font12_Table
只在一个地方真正有用,删除其他不需要的地方的定义。保持只有一个文件包含完整的函数实现。公共/私有接口:如果
Font12_Table
是一个类成员或其他内部细节,可以考虑将其改为私有(private),并在头文件中声明为公共接口(public)。这样,外部只需访问接口,而内部实现不会冲突。宏或预处理器条件:如果是全局变量或常量,可以使用宏或条件编译来避免在不同模块中重复定义。
// 使用预处理器条件
#ifdef _FILE_NAME_FONT12_
# define FONT12_TABLE ...
#else
# define FONT12_TABLE ...
#endif
// 或者使用宏
extern FONT12_TABLE;
记得更新所有依赖Font12_Table
的地方,确保一致性。
相关推荐
















