Static libraries and dynamic libraries

Source: Internet
Author: User

Static Library
. A-Static library-"compile-time connected libraries, compile the code when the library's binary import compiled into the program
. dylib-"Dynamic Library-" When you run the program, the call to the relevant function will be connected to the dynamic library,

. framework-can be either a static library or a dynamic


1. Function of the library-"1. Non-burst source code (for a lot of source code package into binary) 2. Simple to use, only need to import libraries and header files to use
2. How to Make
3. How to use


Package Some implementation code that you don't want to expose to the consumer. A library (for example: Baidu Map SDK, when writing the SDK, need to use)

Need to create a static library project to implement the code logic and complete the packaging of the code (. a library)
Create a test project (using. a library) (import the. A library and the necessary header files into the test project)

Static library packaging (1, based on the simulator-generated. A library, this. A library is a computer-based CPU (i386) logic generated and cannot be used on a real machine
2, based on the real machine generated. A library (ARMV6,ARMV7 smartphone CPU logic) cannot be used in an emulator environment)

Synthesize two static libraries into one
Must write out the absolute path of two static libraries
Lipo-create/ospath/libname.a/simulatorpath/libname.a-output/allinonelibname.a

In the terminal input
Merge. A
lipo-create/users/lzxuan/desktop/libmycontrol.a/users/lzxuan/desktop/mycontrol/libmycontrol.a-output/users/ Lzxuan/libmycontrol.a

-output the path of the target file appended to


=================
Merging Xxx.framework

1. First copy the generated myframework.framework to the desktop
2. Enter the following instruction
The path behind the-create should be the path of the myframework.framework/myframework in the real machine and the emulator myframework.framework/myframework path
-output is behind the target just now on the desktop myframework.framework/myframework


lipo-create/users/lzxuan/desktop/debug-iphoneos/myframework.framework/myframework/users/lzxuan/desktop/ Debug-iphonesimulator/myframework.framework/myframework-output ~/desktop/myframework.framework/myframework

Static libraries and dynamic libraries

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.