• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to build a static lib with another static lib?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to build a static lib with another static lib?


  • Subject: Re: How to build a static lib with another static lib?
  • From: Brent Gulanowski <email@hidden>
  • Date: Wed, 6 Oct 2004 11:56:00 -0400

If the user knows how to link with one static lib in the first place,
is it really that big a deal to link with two? Not that I don't see
some benefit. There is the problem that the user cannot independently
upgrade the dependent lib since you've merged them (if they try they
will get conflicts).

In Xcode it is certainly possible to link an existing static lib to
the lib you are compiling. I don't use ld or libtool on the CLI myself
-- I just build the lib in Xcode, where you can add the lib just like
you would add a framework or library to any project/target. You can
see that they've been combined based on file size or reading the build
command history (where you can also see the exact commands to make it
happen).

Because for some reason Xcode doesn't let you browse UNIX root
directories (yes I should file a bug, but maybe I missed an option
somewhere?), you sometimes need to drag and drop libs from /usr/ and
such from the Finder after using the "Go to folder..." command.

On Fri, 1 Oct 2004 01:50:02 -0700, Quinn Dunki <email@hidden> wrote:
> I'm new to serious Unix development, and I'm troubled by something. I'm
> building a static library for public use that relies on another static
> library.
>
> I can only get it to work by doing this:
>
> ld endUsersProduct.o -lmyStaticLib -lotherLib
>
> I don't want the user to have to know to link with both libs, or even
> know about -lotherLib. I'm new to libtool, but it doesn't seem to have
> an equivalent of -l in ld. Dynamic Libs have the option to pass flags
> down to ld, but static libs don't. I wouldn't mind having to include
> both libs in the distribution, if there's some way to automate the
> linking of both together.
>
> The ideal solution is to link them together ahead of time into one
> static lib. This was a no brainer on PC, so I'm sure I'm missing
> something obvious here.
>
> Suggestions?
>
> Sandy
>
>  _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Xcode-users mailing list      (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
>


--

Brent Gulanowski
http://www.boredastronaut.com
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: How to build a static lib with another static lib?
      • From: Dan Bernstein <email@hidden>
References: 
 >How to build a static lib with another static lib? (From: Quinn Dunki <email@hidden>)

  • Prev by Date: Static library using a class
  • Next by Date: Re: How do I prevent XCode from parsing an email address?
  • Previous by thread: Re: How to build a static lib with another static lib?
  • Next by thread: Re: How to build a static lib with another static lib?
  • Index(es):
    • Date
    • Thread