IOS duplicate symbol variable in class name error

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.