Hi Everyone,
I am trying to compile code for a FAT file system implementation. I define my struct as
struct DirEntry
{
uint8_t status PACKED;
uint32_t start_block PACKED;
uint32_t num_blocks PACKED;
uint32_t fsize PACKED;
MC_Time created PACKED;
MC_Time modified PACKED;
uint8_t fname[31] PACKED;
uint8_t unused[6] PACKED;
};
typedef struct DirEntry d_Entry;
in a file called common.h
then in a file called common.c
I create the method as follows:
void get_DEntry(d_Entry *DEntry, FILE *image)
{
size_t Sz = 64;
size_t Ct = 1;
fread(DEntry,Sz,Ct,image);
DEntry->start_block = ntohl(DEntry->start_block);
DEntry->num_blocks = ntohl(DEntry->num_blocks);
DEntry->fsize = ntohl(DEntry->fsize);
DEntry->created.year = ntohs(DEntry->created.year);
DEntry->modified.year = ntohs(DEntry->modified.year);
}
I envoke the method by doing:
get_SBlock(&SBlock, image);
When I compile I get the following error:
In function `get_DEntry':
: multiple definition of `get_DEntry'
common.o(.text+0x0): first defined here
I was hoping someone could help me figure out why I'm getting this error.
Thanks
Mindy