From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32637 invoked by alias); 14 Dec 2004 17:29:26 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 32411 invoked from network); 14 Dec 2004 17:29:20 -0000 Received: from unknown (HELO NUTMEG.CAM.ARTIMI.COM) (217.40.111.177) by sourceware.org with SMTP; 14 Dec 2004 17:29:20 -0000 Received: from mace ([192.168.1.25]) by NUTMEG.CAM.ARTIMI.COM with Microsoft SMTPSVC(6.0.3790.211); Tue, 14 Dec 2004 17:27:37 +0000 From: "Dave Korn" To: Subject: RE: why is -L/usr/local/lib necessary? Date: Tue, 14 Dec 2004 17:29:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit In-Reply-To: Message-ID: X-OriginalArrivalTime: 14 Dec 2004 17:27:37.0125 (UTC) FILETIME=[34771D50:01C4E202] X-SW-Source: 2004-12/txt/msg00498.txt.bz2 > -----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/