ERRORS:
1) _counter already defined error
2) one or more multiply defined symbols found
structure.h:
extern int counter = 0;
List.c:
in one method i increment the counter.
++counter;
in another method i set the counter to a value within an object
llist->taskID = counter;
Messages.c:
use counter for while loop
while(counter < 1)
{
//do stuff
}
why does this error occur? I did a ctrl F and searched for all the instances i use counter… these are the only instances i use it…
Your header file
structure.hshould only have a declaration (not a definition), like:One (only) of the implementation files, conventionally the
*.cfile containingmain, should have a definition like