Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 840901
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T05:42:13+00:00 2026-05-15T05:42:13+00:00

which is the best approach to include a static library with into an application

  • 0

which is the best approach to include a static library with into an application for iPhone or iPad?

I could choose to

  • compile the library supplying right platform and building a library file with the ar utility and then add as a framework to the project
  • including the source of the library .c/.h and compile them together with the application

The first approach seems simpler, because I won’t care about managing all specific settings of the library I want to include but how can I create the library both for iPhone and iPad and allow xcode to use the right library upon linking?

The second approach seems more complex since xcode will take care about compiling my application and the library (with different settings I suppose) then how should I go? I can easily add sources of the lib but I’ll have to include the make scripts to allow xcode use them to build in the right way.

Any suggestions about how to proceed? The library I’m trying to include is libssh. (I know that this library, of course, has already been compiled and tried succesfully on iPhone)

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T05:42:14+00:00Added an answer on May 15, 2026 at 5:42 am

    I would go for the first approach.

    You should probably build two different versions of your library, one for the iPhone and one for the iPad. These have to be fat libraries containing different architectures (armv6 for iPhone 3G, armv7 for iPhone 3GS, and i386 for the iPhone simulator the first, armv7 and i386 the other one for the iPad).

    Basically you build three different versions for the iPhone, then merge them together in a fat file using the lipo tool.

    Then, you build again two different versions for the iPad and merge them together using lipo. Note that you can not reuse for the iPad the armv7 and i386 version you compiled originally for the iPhone, because you need to build them using compilers belonging two different SDKs (3.1 for the iPhone, 3.2 for the iPad).

    I am not sure if lipo will allow you to merge into a single file two armv7 or two i386 versions of the library without complaining. You may want to try this, because in this case you can come up with just one fat library at the end of the whole process.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.