iOS Learning note 64--about linker command failed with exit code error

Source: Internet
Author: User

Because recently took over to do Static library colleague's work, such inevitable integration debugging Ah, but after integration always appear linker command failed with exit code 1 This error, check a lot of information, finally solved, today on this issue to do a discussion, In order to prevent the same mistakes in the future, I first say I this project inside the wrong solution, and then general say other solutions.

Okay, this is my show. linker command failed with exit code The wrong solution is also one of the reasons for this error, and the response path of the static library is not correct.

Okay, here's the linker command failed with exit code error All the workarounds are listed for later use

1. Multiple-person-developed file conflicts or. m did not add problems with the following error:



Solution: Find the name of the class that appears, find the. m, such as a local hook.



2.

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

repeat the first step process and then find Build settings->linking->other Linker Flags, such as




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)


There were errors in all the files used in this library, as above

homeviewcontroller.o

Classes and

analysisviewcontroller.o

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. As





4. It is also common to see if a newly added file has the same name as the previous file.


5. The name of a class appears in the error message, go to the original file to see what third-party libraries #import, exclude these libraries from one another, find the wrong library, and then follow the official steps to add it again .


The above is the general solution of the above errors, if not resolved, it is only a way out.

Now that we've talked about the confusion of third-party static library paths, I'll talk to you about this path next, which is one of the common mistakes.


< Span style= "line-height:18px" >

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.