iOS duplicate symbols for architecture x86_64 error

Source: Internet
Author: User

We may often encounter such an error during our code writing:

[OBJC]View Plaincopy print?
    1. <span style="Font-size:32px;color: #ff0000;" >LD: 4 Duplicate symbols for architecture x86_64
    2. Clang: error:linker command failed with exit code 1 (use-v to see invocation) </span>


Read the cause of the error carefully to find a few key words: "duplicate" and "symbols".

The Chinese meaning of duplicate is " duplicated and duplicated", while symbols means "symbol". That is, it is possible to introduce repetitive things into your project.

I concluded that there are two general situations in which there is a duplicate error:

The first scenario is that you re-import a class or file in your project, which generally occurs when you add a third-party library, and you import the same class again without knowing it.

In the project I created a src folder, the person class has been copied again and added to the project,



At this point, the following error occurred after COMMAND + B was compiled:



Can be seen to report or duplicate error, although duplicate front of the number may not be accurate, but as long as you see duplicate this keyword can go to your project to find whether there is duplicate things are imported.

The second case: The project in the #import introduction of the header file, the #import "XXX.h" written #import "XXX.M". Incorrect introduction of. m header file

I have a class of person in my project, and then I want to initialize an object in the main function, this time I need to introduce the. h file of the person class first. This time I introduced the. m file,


COMMAND + B compiles after errors are found,


You will find that the duplicate is still a mistake. At present, I only found that these two operations will bring this problem, the other if it will bring this problem, welcome everyone to put forward, help me to constantly improve the blog.

iOS duplicate symbols for architecture x86_64 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.