Subject: Re: How does ELF work?
To: gregory duchesnes <>
From: Manuel Bouyer <>
List: netbsd-users
Date: 07/06/2004 22:56:02
On Tue, Jul 06, 2004 at 10:23:24PM +0200, gregory duchesnes wrote:
> Hi,
> I have a problem compiling postfix with mysql support, make complains about
> a missing
> i know it is a dynamic linked libraries problem and i managed to solve it by
> creating a /etc/ file containing the path to the mysql libs.
> BUT, i read on the ELF Faq that it was a bad thing to do (too bad since it's
> so easy) and i'd like to do it properly thanks to ELF
> The problem is that i've read the FAQs and ELF man pages but i don't
> understand anything about how it works.

Are you compiling from pkgsrc, or directly from sources ?
I would suggest using pkgsrc, as it will do all of this for you.

Otherwise, before the -lmysqlclient on the link command line, you need to
-L/path/to/directory/where/ -Wl,-R/path/to/directory/where/

-L tells the compiler (linker, really) where to find,
to get symbols, etc ...
-Wl,-R records in the executable where to look for at
run time.

Manuel Bouyer <>
     NetBSD: 26 ans d'experience feront toujours la difference