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



Thanks for all the suggestions. The best one so far is to create link to the static library, and link against the new name. There's no way on Darwin to say "prefer the .a over the .dylib", or so I'm told.

Using the full pathname in place of the "-lname" form may result in a larger executable, although in my case, it didn't. I don't know whether that's always the case.

Regards,

Justin

On Monday, December 9, 2002, at 08:38 AM, chas williams wrote:

perhaps a cleaner way might be to specify the full path to the .a
when linking. as follows:

% cc sample.c /usr/lib/libpcap.a
% otool -L a.out
a.out:
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 62.0.0)

using -l of course, you get the shared library version:

% cc sample.c -lpcap
% otool -L a.out
a.out:
/usr/lib/libpcap.A.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 62.0.0)


--
Justin C. Walker, Curmudgeon-At-Large *
Institute for General Semantics | Men are from Earth.
| Women are from Earth.
| Deal with it.
*--------------------------------------*-------------------------------*
_______________________________________________
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: chas williams <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.