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: linking libraries



On Jan 27, 2004, at 1:35 PM, David R. Morrison wrote:

Rich Cook <email@hidden> wrote:

On Jan 26, 2004, at 8:29 PM, Bill Northcott wrote:

From: Rich Cook <email@hidden>
Hmmm... How is placing a useful library in a standard location like
/usr/local/lib "pollution?"

/usr/local/lib is only marginally different to /sw/lib. If either is
in the default ld/dyld search paths or I use -L/usr/local/lib in a
link command, I am immediately condemned to link all the Fink/whatever
stuff that has been installed, whether I want it or not. That is what
I mean by pollution. Obviously the same applies to headers at compile
time.

You are just incorrect here. -L/usr/local/lib does not link *ANYTHING*
in, it simply adds /usr/local/lib to the search paths for libs you
explicitly request with -lname.
Also, there is an important difference between /sw/lib and
/usr/local/lib that seems to escape your attention: everybody else
knows about /usr/local/lib, whereas /sw/lib is a bit odd. Following
convention can be useful when porting codes across multiple platforms.

There is another difference which you may be unaware of. At least with
gcc, you don't need -L/usr/local/lib because that is already in the
search path for libraries. So, if your goal was to set things up so
that it was possible to *avoid* the library when you want to, you would
install it someplace other than /usr/local/lib. Which is what fink does.



thank you, you're right, I didn't know Apple's gcc assumed /usr/local/lib as well. I agree with fink's philosophy of putting things in /sw, no problem there.


--
Richard Cook
Lawrence Livermore National Laboratory
Bldg-451 Rm-2043, Mail Stop L-561
7000 East Avenue, Livermore, CA, 94550, USA
phone (925) 423-9605 (work) fax (925) 423-8704
---
Information Management & Graphics Grp., Services & Development Div., Integrated Computing & Communications Dept.
(opinions expressed herein are mine and not those of LLNL)
_______________________________________________
scitech mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/scitech
Do not post admin requests to the list. They will be ignored.

References: 
 >linking libraries (From: "David R. Morrison" <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.