Lipo compilation and integration of general static class libraries for iPhone simulators and real machines

Source: Internet
Author: User

LipoCompile and mergeIPhone SimulatorUniversal with zhenjiStatic class libraryThis document describes how to create static links in static class libraries for ios.LibraryNow the problem is that after compilation, we will use the. a file of two versionsSimulatorAndIPhoneReal machine, because Mac andIPhoneThis is the case only when the CPU is different. It is a bit like PowerMac and InterMac.

In useStatic class libraryIf we wantSimulatorFor debugging, you must useSimulatorThe lib version is added to the project. Similarly, if you want to runIPhoneWe 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 classLibraryNo. during compilation in Xcode 3.2 of Snow Leopard, a warning is displayed: *** is not required ***. 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:

 
 
  1. lipo -create 

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

 
 
  1. lipo -create /Users/Travis/Desktop/libIMIUI.d.a /Users/Travis/Desktop/libIMIUI.s.a 

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

 
 
  1. -output /Users/Travis/Desktop/libIMIUI.a 

The following command is used:

 
 
  1. lipo -create /Users/Travis/Desktop/libIMIUI.d.a /Users/Travis/Desktop/libIMIUI.s.a -output /Users/Travis/Desktop/libIMIUI.a 

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

Summary:LipoCompile and mergeIPhone SimulatorUniversal with zhenjiStatic class libraryI hope this article will help you.

Related Article

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.