From owner-freebsd-hackers@FreeBSD.ORG Wed Mar 31 14:56:07 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7931616A4CE for ; Wed, 31 Mar 2004 14:56:07 -0800 (PST) Received: from kientzle.com (h-66-166-149-50.snvacaid.covad.net [66.166.149.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2C62643D1D for ; Wed, 31 Mar 2004 14:56:07 -0800 (PST) (envelope-from tim@kientzle.com) Received: from kientzle.com (p54.kientzle.com [66.166.149.54]) by kientzle.com (8.12.9/8.12.9) with ESMTP id i2VMu590029491; Wed, 31 Mar 2004 14:56:05 -0800 (PST) (envelope-from tim@kientzle.com) Message-ID: <406B4C80.70708@kientzle.com> Date: Wed, 31 Mar 2004 14:56:00 -0800 From: Tim Kientzle User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.4) Gecko/20031006 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Richard Bradley References: <200403312312.23601.rtb27@cam.ac.uk> <406B488F.2040602@ec.rr.com> In-Reply-To: <406B488F.2040602@ec.rr.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-hackers@freebsd.org Subject: Re: ld can't find libraries X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Mar 2004 22:56:07 -0000 Richard Bradley wrote: >> >> I can't get ld to recognise some "so" libraries without using the -L >> option: >> >> %gcc test.c -lsqlite >> /usr/bin/ld: cannot find -lsqlite >> %gcc test.c -L/usr/local/lib -lsqlite >> >> However, /usr/local/lib is in its search path: >> >> %ldconfig -r | grep sql ldconfig has nothing to do with ld. ldconfig is associated with the dynamic linker (ld-elf.so.1), which locates dynamic libraries at run-time. ld has a completely separate mechanism for locating (static or dynamic) libraries at compile-time. There may be a way to set the defaults for ld, but I don't happen to know it. Tim Kientzle