public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* why is -L/usr/local/lib necessary?
@ 2004-12-14 17:02 Sam Steingold
  2004-12-14 17:29 ` Chris January
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Sam Steingold @ 2004-12-14 17:02 UTC (permalink / raw)
  To: cygwin

why doesn't "gcc -lfoo" (ld) find /usr/local/lib/foo.dll?
what do I do to avoid this?
-- 
Sam Steingold (http://www.podval.org/~sds) running w2k
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.honestreporting.com>
will write code that writes code that writes code for food

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: why is -L/usr/local/lib necessary?
  2004-12-14 17:02 why is -L/usr/local/lib necessary? Sam Steingold
@ 2004-12-14 17:29 ` Chris January
  2004-12-14 17:29 ` Dave Korn
       [not found] ` <E1CeGU9-0000hO-00@deer.gmane.org>
  2 siblings, 0 replies; 8+ messages in thread
From: Chris January @ 2004-12-14 17:29 UTC (permalink / raw)
  To: sds; +Cc: cygwin

> why doesn't "gcc -lfoo" (ld) find /usr/local/lib/foo.dll?
> what do I do to avoid this?

Edit /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/specs 

Chris


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: why is -L/usr/local/lib necessary?
  2004-12-14 17:02 why is -L/usr/local/lib necessary? Sam Steingold
  2004-12-14 17:29 ` Chris January
@ 2004-12-14 17:29 ` Dave Korn
  2004-12-14 17:37   ` Dave Korn
  2004-12-14 17:53   ` Sam Steingold
       [not found] ` <E1CeGU9-0000hO-00@deer.gmane.org>
  2 siblings, 2 replies; 8+ messages in thread
From: Dave Korn @ 2004-12-14 17:29 UTC (permalink / raw)
  To: cygwin

> -----Original Message-----
> From: cygwin-owner On Behalf Of Sam Steingold
> Sent: 14 December 2004 17:02

> Subject: why is -L/usr/local/lib necessary?
> 
> why doesn't "gcc -lfoo" (ld) find /usr/local/lib/foo.dll?

Two reasons:

1)  It won't look in /usr/local/lib by default.  "gcc -print-search-dirs" should
clarify this for you, or "gcc -v -lfoo", which shows you the exact command line
used to invoke ld.

2)  You can't statically link against a .dll anyway.  You statically link (at
compile time) against .a files; you dynamically link (at runtime) against .dll
files.

> what do I do to avoid this?

  Don't write a program that needs to link against libfoo?

  Look, you have only two choices.  Either put your libs in the default search
path, or specify the path.  It's not unreasonable that gcc can't magically guess
where you've hidden them.

    cheers, 
      DaveK
-- 
Can't think of a witty .sigline today....


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: why is -L/usr/local/lib necessary?
  2004-12-14 17:29 ` Dave Korn
@ 2004-12-14 17:37   ` Dave Korn
  2004-12-14 17:53   ` Sam Steingold
  1 sibling, 0 replies; 8+ messages in thread
From: Dave Korn @ 2004-12-14 17:37 UTC (permalink / raw)
  To: cygwin

> -----Original Message-----
> From: cygwin-owner On Behalf Of Dave Korn
> Sent: 14 December 2004 17:28


> 2)  You can't statically link against a .dll anyway.  You 
> statically link (at
> compile time) against .a files; you dynamically link (at 
> runtime) against .dll files.

  Minor correction:  you can in fact link against a dll, but it doesn't actually
link the function from the dll into your exe, it links a __imp__FunctioName
stub.  So it's the same as linking against the corresponding static import
library (libfoo.dll.a in this case) anyway.

    cheers, 
      DaveK
-- 
Can't think of a witty .sigline today....


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: why is -L/usr/local/lib necessary?
  2004-12-14 17:29 ` Dave Korn
  2004-12-14 17:37   ` Dave Korn
@ 2004-12-14 17:53   ` Sam Steingold
  1 sibling, 0 replies; 8+ messages in thread
From: Sam Steingold @ 2004-12-14 17:53 UTC (permalink / raw)
  To: cygwin, Dave Korn

> * Dave Korn <qnir.xbea@negvzv.pbz> [2004-12-14 17:27:37 +0000]:
>
> Look, you have only two choices.  Either put your libs in the default
> search path, or specify the path.  It's not unreasonable that gcc
> can't magically guess where you've hidden them.

I agree, with a minor additions:

1. /usr/local/lib/ is a fairly standard location, and it appears that
   gcc and ld.so on linux are aware of it.
   I see no good reason for cygwin to ignore it.

2. linux has /etc/ld.so.conf where I can put my "hidden" directories so
   that I do not have to put them in the command line.
   is there a similarly magical file on cygwin?

-- 
Sam Steingold (http://www.podval.org/~sds) running w2k
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.honestreporting.com>
Why use Windows, when there are Doors?

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: why is -L/usr/local/lib necessary?
       [not found] ` <E1CeGU9-0000hO-00@deer.gmane.org>
@ 2004-12-14 19:53   ` Andrew Schulman
  2004-12-15 12:06     ` Dave Korn
  0 siblings, 1 reply; 8+ messages in thread
From: Andrew Schulman @ 2004-12-14 19:53 UTC (permalink / raw)
  To: cygwin

> > why doesn't "gcc -lfoo" (ld) find /usr/local/lib/foo.dll?
> > what do I do to avoid this?
> 
> Edit /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/specs 

Geez, that thing should be in /etc.

-- 
To reply by email, replace "deadspam.com" by "alumni.utexas.net"


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: why is -L/usr/local/lib necessary?
  2004-12-14 19:53   ` Andrew Schulman
@ 2004-12-15 12:06     ` Dave Korn
  0 siblings, 0 replies; 8+ messages in thread
From: Dave Korn @ 2004-12-15 12:06 UTC (permalink / raw)
  To: cygwin

> -----Original Message-----
> From: cygwin-owner On Behalf Of Andrew Schulman
> Sent: 14 December 2004 19:53

> > > why doesn't "gcc -lfoo" (ld) find /usr/local/lib/foo.dll?
> > > what do I do to avoid this?
> > 
> > Edit /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/specs 
> 
> Geez, that thing should be in /etc.

  Actually it should not in general be edited or tampered with whatsoever.  Mess
up with the order of system and installation-local paths and you risk breaking
all sorts of build scripts.

    cheers, 
      DaveK
-- 
Can't think of a witty .sigline today....


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: why is -L/usr/local/lib necessary?
       [not found] <E1CeGTv-0006As-PO@monty-python.gnu.org>
@ 2004-12-14 17:44 ` Sam Steingold
  0 siblings, 0 replies; 8+ messages in thread
From: Sam Steingold @ 2004-12-14 17:44 UTC (permalink / raw)
  To: Chris January; +Cc: cygwin

> * Chris January <puevf@ngbzvpr.arg> [2004-12-14 17:28:55 +0000]:
>
>> why doesn't "gcc -lfoo" (ld) find /usr/local/lib/foo.dll?
>> what do I do to avoid this?
>
> Edit /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/specs 

how?
(and will the executable run - or do I need to add /usr/local/lib/ to PATH)

-- 
Sam Steingold (http://www.podval.org/~sds) running w2k
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.honestreporting.com>
Trespassers will be shot.  Survivors will be prosecuted.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2004-12-15 12:06 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-12-14 17:02 why is -L/usr/local/lib necessary? Sam Steingold
2004-12-14 17:29 ` Chris January
2004-12-14 17:29 ` Dave Korn
2004-12-14 17:37   ` Dave Korn
2004-12-14 17:53   ` Sam Steingold
     [not found] ` <E1CeGU9-0000hO-00@deer.gmane.org>
2004-12-14 19:53   ` Andrew Schulman
2004-12-15 12:06     ` Dave Korn
     [not found] <E1CeGTv-0006As-PO@monty-python.gnu.org>
2004-12-14 17:44 ` Sam Steingold

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).