Compile the. A library file used by iOS

Source: Internet
Author: User

The first is the source file that needs to be compiled into. A

hello.h :

#ifndef __include_hello_h__#define __include_hello_h__void HELLO (const char *name); #endif//End __include_hello_h__


hello.c

#include "stdio.h" void Hello (const char *name) {    printf ("Hello World%s\n", name);}


1. Create a library Project with Xcode



2, to configure

Remove the original. h and. M:



Add the above. C and. H to the project:



Configuration item minimum configuration is iOS6.0




3, compile, get libhello.a


Open to the directory, you can view, has generated the emulator's. A library and the real machine. A library




4, in the test project to test the generated . A library

Simulator's:




The real machine (need to load the library note is not the same):





5. Merge the real hangar and simulator library into one piece

Use Lipo-create (three files to merge together)-output (file name merged together)

First I copy these two files to the desktop, then modify the corresponding name, one for libhelloi386.a and the other for libhello7.a, and then execute the following command on the terminal:





6, the entire test project (including iOS test Project and Lib Library project)

csdn:http://download.csdn.net/detail/zengraoli/8115253

Compile the. A library file used by iOS

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.