iOS development   references third-party libraries appear duplicat ...

Source: Internet
Author: User


In the development of iOS, it is inevitable to integrate other people's three-way library, when the integration of the three-party library too much, it will inevitably appear some libraries at the same time using the same library, resulting in link when the error promptduplicate symbol. See picture for details:
References to third-party libraries appear duplicateHow to deal with symbol "title=" iOS developmentReferences to third-party libraries appear duplicateHow to handle symbol when "/>


Such an error makes us feel very troublesome, such a file duplication error, not by the code in their own programs, but other people's three-way library, that is, in this case, we can not modify their own code to solve the problem. We can only ask the third party (the provider of the function library) to provide the source code, and then modify it, or let the three-party code providers themselves to modify the later to us, anyway, how much will feel a bit unreasonable requirements.Then we can only think of ways to solve ourselves, that is, modify the. A file or a binary file in the framework.
To modify such errors, we need to use the Lipo and AR tools.Do not know how to use the Web to search a little bit.
Then let's revise it now.

One, find duplicate library files (two library files repeatedly find one of them, three library files, find duplicate files of two of them, ... And so on), you can directly in the project folder under the operation (not recommended, easy to make the program problems), you also copy the library files to other folders to operate. Here we copy to other folders to operate. Files that need to be copied see figure: References to third-party libraries appear duplicateHow to deal with symbol "title=" iOS developmentReferences to third-party libraries appear duplicateHow to handle symbol when "/>


Second, open the terminal, and CD to the folder, usingLipo-infoAsiaidcardreader(Asiaidcardreader to replace it with its ownFile name) View the schema information under this file and leave it with a reference to a third-party library to appear duplicateHow to deal with symbol "title=" iOS developmentReferences to third-party libraries appear duplicateHow to handle symbol when "/>

Third, we can see the last line of information, herearchitecturesin The FAT file, which shows that this is a fat document, we need to thin the file first, that is, to separate out the ARMV7, arm64, and armv7s files.  Using commandsLipo Asiaidcardreader -thin armv7-output Asiaidcardreader. ARMV7 (in Asiaidcardreader.armv7Asiaidcardreader can be replaced by its ownfile name, and the name can be customized), use a similar method (you only need to modify the. ARMv7 to the corresponding schema information suffix) to separate the other files
References to third-party libraries appear duplicateHow to handle symbol when "/>

Four, the file has been separated, the following we use the AR tool to view the files under the binary files (. o file).Here we can use AR-T to view all the. o files in the terminal to refer to a third-party library appears duplicateHow to deal with symbol "title=" iOS developmentReferences to third-party libraries appear duplicateHow to handle symbol when "/>

You can also use ar-x to separate all. o files into the specified directory folder. References to third-party libraries appear duplicateHow to deal with symbol "title=" iOS developmentReferences to third-party libraries appear duplicateHow to handle symbol when "/>

Based on our initial error location, we can easily find duplicate files from above.ASYNCSOCKET.O andAsyncsocket related files, the next step is to modify the detached files.

v. Use of commands ar-d-sv asiaidcardreader.armv7s ASYNCSOCKET.O, that is, deleteasiaidcardreader.armv7s under the ASYNCSOCKET.O Binaries (you just need to replace your own library file name with the. o file) and do the same for the isolated. arm64,. armv7s.
References to third-party libraries appear duplicateHow to deal with symbol "title=" iOS developmentReferences to third-party libraries appear duplicateHow to handle symbol when "/>


Six, the document has been modified, and then we need to put the modified files, all again into our original framework of the FAT file. Using commandsLipo-create-output AsiaidcardreaderaSiaidcardreader.armv7sasiaidcardreader.arm64AsIaidcardreader.armv7 (you need to add all the separated files here)In order for us to confirm the restoration ofAsiaidcardreader file, we will copy the file under the folder to delete, and then do the operation. After using the command, we can see that we have generated a newAsiaidcardreader file, this is the document that we have modified to meet our needs.
Seven, the modified files, drag and drop to the original folder, replace the original file.
Note: The others are repeated by the framework, as described above.
Well, according to this method, I solved their own problems, there is nothing wrong, but also hope that we have a lot of guidance, finally, this tutorial with the help of blog: http://angelolloqui.com/blog/31- How-to-fix-a-duplicated-symbols-error-on-binary-files

iOS development   references third-party libraries appear duplicat ...

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.