Appears (linker command failed with exit code 1) Error Summary

Source: Internet
Author: User

This problem usually occurs when you add a third-party library file or when you develop multiple people.

This problem is usually a link error that is caused by a file not being found. We can proceed from the following aspects of the investigation.

1. Take the following error as an example, if you are a multi-person developer, you will find the following error when you complete the synchronization.

    1. Undefined Symbols for Architecture armv7:
    2. "_objc_class_$_mypagelogviewcontroller", referenced from:
    3. Objc-class-ref in BAIDUMOBSTATAPPDELEGATE.O
    4. Ld:symbol (s) not found for architecture armv7
    5. Clang:error:linker command failed with exit code 1 (use-v to see invocation)

The "Mypagelogviewcontroller" class appears in the error, and you can find the. m file for this class and see his target membeship, as

If it is not checked, click on the check box. And then compile the view.

2. If it is a newly added third-party library and is not a static library

Repeat the first step and then find the Build settings->linking->other Linker Flags

Modify this property to-all_load or-OBJC, depending on the situation. In short, you can try more than a few times.

3. If you are adding a third-party static library (. a file)

    1. Undefined Symbols for Architecture armv7:
    2. "_objc_class_$_baidumobstat", referenced from:
    3. Objc-class-ref in BAIDUMOBSTATAPPDELEGATE.O
    4. Objc-class-ref in MYPAGELOGVIEWCONTROLLER.O
    5. (Maybe you meant: _objc_class_$_baidumobstatappdelegate)
    6. Ld:symbol (s) not found for architecture armv7
    7. Clang:error:linker command failed with exit code 1 (use-v to see invocation)

Errors have occurred in all files used in this library, such as the Baidumobstatappdelegate class and the Mypagelogviewcontroller class

This could be a link error caused by this static library path confusion.

Workaround: Build settings->search path->library Search Paths Add the appropriate path to the static library. Such as

If none of the above methods works. You can try a few more ways:

1 to see if there is a newly added file with the same name as the previous file

2, the error message appears in the name of a class, go to the original file to see what the third-party library, the library #import, find out the wrong library, and then follow the official steps to re-add again.

Appears (linker command failed with exit code 1) Error Summary

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.