hey every1! iv never posted on this site before but have view the site and have benifitted from the help given here. hope some1 can help me with this prob!
Ok, i have 2 files, 1 which i want 2 contain arrays of words, and the other to contain the main program. I want to link to these arrays and select words from them randomly.
I canget everything working except the linking.
Heres what i have at the min, along with the errors i get! ive tried changing it a few times but cant understand why it wont work.
1st file (declarations)
#ifndef gM
char NOUN[5][6] ={"noun1","noun2","noun3","noun4","noun5"};
#endif
#ifndef gM
char VERB[5][6] ={"verb1","verb2","verb3","verb4","verb5"};
#endif
#ifndef gM
char ADJ[5][6] ={"adjt1","adjt2","adjt3","adjt4","adjt5"};
#endif
#ifndef gM
char PREP[5][6] ={"prep1","prep2","prep3","prep4","prep5"};
#endif
#ifndef gM
char AVRB[5][6] ={"avrb1","avrb2","avrb3","avrb4","avrb5"};
#endif
2nd file (containing main program)
//Declare variables and initalise
extern char NOUN[5][6];
extern char VERB[5][6];
extern char ADJ[5][6];
extern char PREP[5][6];
extern char AVRB[5][6];
error:
f2.obj : error LNK2005: _AVRB already defined in f1.obj
f2.obj : error LNK2005: _PREP already defined in f1.obj
f2.obj : error LNK2005: _ADJ already defined in f1.obj
f2.obj : error LNK2005: _VERB already defined in f1.obj
f2.obj : error LNK2005: _NOUN already defined in f1.obj
f1.exe : fatal error LNK1169: one or more multiply defined symbols found
what am i doing wrong? thanks!