From owner-freebsd-questions Wed Nov 10 21:58:29 1999 Delivered-To: freebsd-questions@freebsd.org Received: from cc942873-a.ewndsr1.nj.home.com (cc942873-a.ewndsr1.nj.home.com [24.2.89.207]) by hub.freebsd.org (Postfix) with ESMTP id 6E8F514D7B; Wed, 10 Nov 1999 21:58:23 -0800 (PST) (envelope-from cjc@cc942873-a.ewndsr1.nj.home.com) Received: (from cjc@localhost) by cc942873-a.ewndsr1.nj.home.com (8.9.3/8.9.3) id BAA45854; Thu, 11 Nov 1999 01:01:57 -0500 (EST) (envelope-from cjc) From: "Crist J. Clark" Message-Id: <199911110601.BAA45854@cc942873-a.ewndsr1.nj.home.com> Subject: Re: ldconfig finding libraries, but ld is not. In-Reply-To: from Scott Benjamin at "Nov 10, 1999 09:05:23 pm" To: sab@sinai.dhs.org (Scott Benjamin) Date: Thu, 11 Nov 1999 01:01:57 -0500 (EST) Cc: bright@wintelcom.net (Alfred Perlstein), stable@FreeBSD.ORG, questions@FreeBSD.ORG Reply-To: cjclark@home.com X-Mailer: ELM [version 2.4ME+ PL54 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Scott Benjamin wrote, > On Wed, 10 Nov 1999, Alfred Perlstein wrote: > > > On Wed, 10 Nov 1999, Scott Benjamin wrote: > > > > > > > > I've installed some libs on my machine (3.3-STABLE 11-09-1999) in > > > /usr/local/lib, via ports and some tarballs. I have let ldconfig_path in > > > rc.conf. When I do a ldconfig -r -v -elf | grep libname, it finds the > > > correct library. but when I try to link, the linker can't find the > > > libraries. Any ideas? I'm a bit frustrated. I would prefer to not set > > > LD_LIBRARY_PATH if at all possible. > > > > you must either set LD_LIBRARY_PATH or use the -L/path/to/wierd/library/dir > > flag to gcc to tell it where to look. > > > > -Alfred > > > > I've tried the LD_LIBRARY_PATH and it still doesn't work. Any more > suggestions? Did you try using the '-L' option on the compile command line? And you are using the '-l' option too? For example, you are trying to include /usr/local/libweird.a in your executable, you would need to have '-L/usr/local/lib -lweird' on the compile command line (if you are using default Makefile rules, just add the quoted portion to the LDCONFIG variable). IIRC, both ldconfig(8) and LD_LIBRARY_PATH are for the _runtime_ shared library linker and have nothing to do compiling programs. -- Crist J. Clark cjclark@home.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message