变量被重复定义的问题,敬请指教: 在Fat32.h中定义: #ifndef _FAT32_H #define _FAT32_H struct FileInfoStruct FileInfo; //文件信息结构体实体 struct FAT32_Init_Arg Init_Arg; //初始化参数结构体实体 #endif
在fat32.c中 #include "fat32.h"= 使用结构体Init_Arg和 FileInfo
在sdwriteread.c函数中使用 #include "fat32.h" extern void FAT32_Init(struct FAT32_Init_Arg * arg ); extern struct FileInfoStruct * FAT32_OpenFile(char *filepath);
void main() { Uint32 i, temp=0; unsigned char BPB_temp=0x00; CSL_init(); SdRead_Sector(temp,data_buff); FAT32_Init(&Init_Arg); FAT32_OpenFile("ABC.TXT"); asm( " nop "); } 编译后出现错误的结果: >> error: symbol _Init_Arg is defined multiple times: E:projects
ead_write_cpl2Debugfat32.obj and E:projects
ead_write_cpl2Debugsdwriteread.obj >> error: symbol _FileInfo is defined multiple times: E:projects
ead_write_cpl2Debugfat32.obj and E:projects
ead_write_cpl2Debugsdwriteread.obj 头文件已经进行条件编译,还是出现重复定义的问题,不解,请给指点一下,谢谢 |