Use lipo to compile and merge static class libraries for iPhone simulators and real machines

Source: Internet
Author: User
The question is,
After compilation, the. A files of two versions are used for the simulator and the iPhone, respectively. This is caused by the difference between the Mac and the iPhone CPU. It is a bit like powermac and intermac.

This article from: http:// B .imi.im /? P = 255

When using static class libraries, if we want to debug the simulator, we must add the Lib used for the Simulator version to the project. Similarly, if we want to run the lib on the iPhone, we must add the real machine lib to the project to ensure that both platforms can run, but the problem is that we always have a class library that is not needed, during compilation in xcode 3.2 of snow leopard, a warning is displayed: *** is unnecessary ***. a. xcode 3.1 also occasionally appears, but the rule is not summarized.

OK, let's solve this problem!

Assume that the two versions of LIB are libimiui. s. A and libimiui. d. a. Our goal is to merge them into the invincible super general version of libimiui..
Open the command line terminal. app and enter:

Lipo-create

Then drag the two. A files to the terminal window in sequence, and the command line will become like this:

Lipo-create/users/Travis/desktop/libimiui. d. A/users/Travis/desktop/libimiui. S.

Then enter the path of the-output target file, for example:

-Output/users/Travis/desktop/libimiui.

The following command is used:

Lipo-create/users/Travis/desktop/libimiui. d. A/users/Travis/desktop/libimiui. s. A-output/users/Travis/desktop/libimiui.

Enter! Okay, this will generate the generic class library libimiui..

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.