delorie.com/archives/browse.cgi | search |
Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
List-Archive: | <http://sourceware.org/ml/cygwin/> |
List-Post: | <mailto:cygwin AT cygwin DOT com> |
List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs> |
Sender: | cygwin-owner AT cygwin DOT com |
Mail-Followup-To: | cygwin AT cygwin DOT com |
Delivered-To: | mailing list cygwin AT cygwin DOT com |
From: | "Dave Korn" <dave DOT korn AT artimi DOT com> |
To: | <cygwin AT cygwin DOT com> |
Subject: | RE: why is -L/usr/local/lib necessary? |
Date: | Tue, 14 Dec 2004 17:27:37 -0000 |
MIME-Version: | 1.0 |
In-Reply-To: | <u7jnkdda1.fsf@gnu.org> |
Message-ID: | <NUTMEGY0VnkB4ltFlmm00000710@NUTMEG.CAM.ARTIMI.COM> |
X-OriginalArrivalTime: | 14 Dec 2004 17:27:37.0125 (UTC) FILETIME=[34771D50:01C4E202] |
> -----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/
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |