Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Building static



On Fri, 6 Dec 2002, Kevin Van Vechten wrote:

> On Friday, December 6, 2002, at 05:58 PM, Justin C. Walker wrote:
>
> > I want to build an app that is dependent only on the dylibs that "come
> > with" Mac OS X, so Joe Random can just download this thing and run it
> > on his system without having to worry about finding/building the other
> > libraries that it (the app) uses.
>
> A noble pursuit. =)
>
> > I have this building fine, but for one library. That library (gmp)
> > comes in both .dylib and .a forms. How can I force it to use the .a
> > version? As it stands, the app seems to have a predilection for the
> > .dylib. Just to make life more interesting, one of the other (static)
> > libraries depends on gmp. Does this mean I have to rebuild that
> > library first, in some different way than I've done so far?
>
> I assume you're linking with the -lgmp flag. I'm not sure how to force
> -l to use the static library, however, specifying an absolute path to
> the static library works. So try /path/to/libgmp.a instead of -lgmp.
> I doubt you'll need to rebuild the first library.
Unfortunately specifying the full path links the library as an object
which will no doubt make your binary [much] larger than it needs to be.
There are two ways to ensure -lgmp uses the .a library
1) remove the .dylib form. Then the link must use the .a as found
2) specify -static -lgmp
>
> -Kevin
> _______________________________________________
> darwin-development mailing list | email@hidden
> Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-development
> Do not post admin requests to the list. They will be ignored.
>


--
Jerry Pendergraft email@hidden
Endocardial Solutions voice: 651-523-6935
1350 Energy Lane, Suite 110 fax: 651-644-7897
St Paul, MN 55108-5254
_______________________________________________
darwin-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-development
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Building static (From: Kevin Van Vechten <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.