This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: why is -L/usr/local/lib necessary?


> -----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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]