Exactly what you are doing is hard to determine without additional information. However from what is given it appears that you are defining API_BASE
in the ClientRequest.h
file so that in every file you include a new item is defined and you end up with multiple items.
One way this can occur is if you define a global variable incorrectly.
If you declare a global variable in ClientRequest.h
as, say:
int API_BASE;
then every file compiled which includes the header will define its own copy of that variable and you'll get duplicate symbol errors. The correct way to do it is to declare the variable as `extern in the header:
extern int API_BASE;
and to define it once in ClientRequest.m
:
int API_BASE;
The extern
keyword indicates that you are declaring the name and type of a variable which will be defined elsewhere.
All function/methods declaration are implicitly external, but the keyword is required for variables.
HTH