I don't know what to think, here. Basically, what I have are three constants stored in a header file, that my compiler (Dev C ver. 4.9.9.2) is telling me have multiple definitions. I have done everything that I know to do (such as using ifndef/endif) to try and get these errors to go away, but it doesn't work.
Here is some of the relevant code:
Code:
#ifndef _CONSTANTS_H
#define _CONSTANTS_H
const int MAX_ID_SIZE = 16;
const int FILE_BUFFER_SIZE = 80;
const int SYMBOL_TABLE_SIZE = 32;
#endif
Code:
#ifndef _INITIALIZATION_H
#define _INITIALIZATION_H
#include "ScannerParams.h"
#include "Constants.h"
void InitializeSymbolTable(symbol * symbolTable);
#endif
Code:
//Initialization.c
#include "Initialization.h"
void InitializeSymbolTable(symbol * symbolTable){
int x;
for(x = 0; x < SYMBOL_TABLE_SIZE; x++){
symbolTable[x].info = NULL;
symbolTable[x].token_Code = -1;
}
}
Code:
//main.c
#include "Initialization.h"
int HashKey(char * key){
int keyIndex = 0;
int x;
for(x = 0; x < MAX_ID_SIZE; x++){
....
^This code in main.c is the only place where MAX_ID_SIZE is currently being used right now; for whatever reason, C has decided that by using this constant, I am therefore "redefining" it. I don't know how or why.
Do you guys have any ideas on what I'm doing wrong?