The error message is that I declared the public variable in an. h file and then reused it in other classes.
Build Settings->no Common blocks The default is yes, the compiler has an error, you need to modify the build Settings no Common blocks.
What is no Common Blocks?
The official explanation is:
In C, allocate even uninitialized global variables in the data section of the object file, rather than generating them as Common blocks. This have the effect that if the same variable are declared (without extern) in both different compilations, you'll get an Error when you link them. The only reason this might are useful are if you wish to verify that the program would work in other systems which always wor K this.
In the C language, the data segments in the destination file are allocated even uninitialized global variables, rather than generating them as public blocks. To do so, if the same variable is declared (without extern) placed in two different compilations, you will get a wrong effect when you link them. The only reason this may be useful is that if you want to verify that the program will work on other systems, it always works in this way.
IOS duplicate symbol variable in class name error