Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Jun 1999 21:30:29 -0500
From:      Dan Nelson <dnelson@emsphone.com>
To:        Brandon Fosdick <bfoz@glue.umd.edu>
Cc:        Nathan Ahlstrom <nrahlstr@winternet.com>, FreeBSD Questions <freebsd-questions@FreeBSD.ORG>
Subject:   Re: Linking libraries on 3.2-S
Message-ID:  <19990617213029.B9746@dan.emsphone.com>
In-Reply-To: <376996EE.887EADCB@glue.umd.edu>; from "Brandon Fosdick" on Thu Jun 17 20:46:38 GMT 1999
References:  <37697EC6.4FA99E8@glue.umd.edu> <19990617183928.A44151@portage.winternet.com> <376996EE.887EADCB@glue.umd.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
In the last episode (Jun 17), Brandon Fosdick said:
> Nathan Ahlstrom wrote:
> > Brandon Fosdick <bfoz@glue.umd.edu> wrote:
> > > When compiling/linking my own programs I can't seem to link to
> > > any library past the 50th entry in ld hints file. I discovered
> > > this while trying to write an OpenGL program. I can however make
> > > ports that rely on X libs, which are all above the 50th entry.
> > > This seems very wierd to me. I've already tried reinstalling
> > > XFree using sysinstall. Let me know if any more info would
> > > help...
> > 
> > Just to see if this works, try adding -L/usr/X11R6/lib to the LDFLAGS
> > line in the makefile.  Adding the -v option to cc might tell you
> > where it is looking for libraries? (not too sure about this one)
> 
> That did the trick, thanks. Shouldn't it be looking in that directory by
> default? rc.conf has it listed in the directories scanned at boot.
> 
> The -v option prints out the commands it used in the compilation. It
> puts out enough to show that it's only looking in /usr/lib. 

You're confusing run-time link paths with compile-time link paths. 
ldconfig is only used at runtime, to resolve shared library
dependencies.  -L flags on the gcc line are only used at link time, to
resolve both shared and static library dependencies.

ldconfig paths can be specified in /etc/rc.conf.  Unfortunately,
there's no place to add compile-time library paths.  Most software uses
autoconf to scan common directories for the libraries it needs.

	-Dan Nelson
	dnelson@emsphone.com


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19990617213029.B9746>