From owner-freebsd-hackers@FreeBSD.ORG Wed Mar 31 14:12:26 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 0350D16A4CE for ; Wed, 31 Mar 2004 14:12:26 -0800 (PST) Received: from yellow.csi.cam.ac.uk (yellow.csi.cam.ac.uk [131.111.8.67]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7D40343D2F for ; Wed, 31 Mar 2004 14:12:25 -0800 (PST) (envelope-from rtb27@cam.ac.uk) Received: from localhost ([127.0.0.1] helo=sjcd2a.robinson.cam.ac.uk) by yellow.csi.cam.ac.uk with esmtp (Exim 4.12) id 1B8nwd-0000AM-00 for freebsd-hackers@freebsd.org; Wed, 31 Mar 2004 23:12:24 +0100 From: Richard Bradley To: freebsd-hackers@freebsd.org Date: Wed, 31 Mar 2004 22:12:23 +0000 User-Agent: KMail/1.5.3 MIME-Version: 1.0 Content-Disposition: inline X-UID: 25 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <200403312312.23601.rtb27@cam.ac.uk> Subject: 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:12:26 -0000 Hi all, I can't get ld to recognise some "so" libraries without using the -L option: %cat test.c int main () {} %ls /usr/local/lib/libsqlite* /usr/local/lib/libsqlite.a /usr/local/lib/libsqlite.so.2 /usr/local/lib/libsqlite.so %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 search directories: /usr/lib:/usr/lib/compat:/usr/X11R6/lib:/usr/local/lib:/usr/local/lib/compat:/usr/local/lib/mysql:/usr/local/lib/compat/pkg:/usr/local/lib/wine:/usr/local/lib/kde3 504:-lsqlite.2 => /usr/local/lib/libsqlite.so.2 517:-lmysqlclient_r.12 => /usr/local/lib/mysql/libmysqlclient_r.so.12 518:-lmysqlclient.12 => /usr/local/lib/mysql/libmysqlclient.so.12 % What is going on here? Any help would be much appreciated, Rich