[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: Compiling Samba against OpenLDAP 2.0.27



The problem I have is not really the compilation process, when I run
configure it doesn't find the LDAP libraries so when I run make it'll
compile but without LDAP support. I searched all morning for a solution
and haven't found one yet. Though I think the problem is that the
OpenLDAP shared libraries don't link against the liblber and libresolv
cause when you do a ldd -r libldap.so they're not there and you get a
bunch of undefined symbol about stuff that are related to those
libraries and when I compile my small test C file and needed to link it
with those 2 libraries. I need a way to link the shared libraries to
liblber and libresolv when I compile them though I have no idea how to
do that...

I think your compilation problems are similar to my problems but you
could always edit the Makefile and add -lber (and maybe -lresolv too) to
LIBS to see what you get. In Samba 2.2.X I had to add -lresolv to LIBS
in the Makefile so Samba would work with LDAP.

Jean-Rene Cormier


On Thu, 2003-07-03 at 13:03, Alexei Monastyrnyi wrote:
> I'm curious what sort of error message you have exactly.
> I tried to build both samba 3.0.0alpha24 and 3.0.0beta2 with ldap support
> (OpenLDAP 2.1.21) and I wasn't succeed in doing it.
> Here is my error mesages on "make" stage.
> -----------------------------------
> [skipped]
> Compiling popt/popthelp.c
> Compiling popt/poptparse.c
> Linking bin/smbd
> Undefined                       first referenced
>  symbol                             in file
> ber_printf                          passdb/pdb_ldap.o  (symbol belongs to
> implic
> it dependency
> /usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3/../../../liblber.s
> o.2)
> ber_init                            libads/ldap.o  (symbol belongs to
> implicit d
> ependency
> /usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3/../../../liblber.so.2)
> ber_flatten                         passdb/pdb_ldap.o  (symbol belongs to
> implic
> it dependency
> /usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3/../../../liblber.s
> o.2)
> ber_scanf                           libads/ldap.o  (symbol belongs to
> implicit d
> ependency
> /usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3/../../../liblber.so.2)
> ber_memfree                         passdb/pdb_ldap.o  (symbol belongs to
> implic
> it dependency
> /usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3/../../../liblber.s
> o.2)
> ber_bvdup                           libads/ldap.o  (symbol belongs to
> implicit d
> ependency
> /usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3/../../../liblber.so.2)
> ber_bvfree                          passdb/pdb_ldap.o  (symbol belongs to
> implic
> it dependency
> /usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3/../../../liblber.s
> o.2)
> ber_free                            passdb/pdb_ldap.o  (symbol belongs to
> implic
> it dependency
> /usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3/../../../liblber.s
> o.2)
> ber_alloc_t                         passdb/pdb_ldap.o  (symbol belongs to
> implic
> it dependency
> /usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3/../../../liblber.s
> o.2)
> ld: fatal: Symbol referencing errors. No output written to bin/smbd
> collect2: ld returned 1 exit status
> make: *** [bin/smbd] Error 1
> 
> Building samba 2.2.8a with ldap support is OK.
> 
> To tell the truth I see no points to strugge for 3.0beta.
> It's just a curiosity if someone has it working. :-)
> 
> ----- Original Message -----
> From: "Jean-Rene Cormier" <jean-rene.cormier@cipanb.ca>
> To: "openldap openldap" <openldap-software@OpenLDAP.org>
> Sent: Thursday, July 03, 2003 3:45 PM
> Subject: Compiling Samba against OpenLDAP 2.0.27
> 
> 
> > Hi, I'm having some problems when compiling Samba against the OpenLDAP
> > 2.0.27 shared libraries, I'm trying to compile Samba 3.0beta2 with LDAP
> > support but it can't find the ldap libraries for some reason. I'm not a
> > programmer so I don't understand how all these autoconf/automake script
> > works but I did some research and it seems that Samba is testing to see
> > if the ldap_init function is there and automake/autoconf or whatever is
> > compiling a small test program with -lldap. I did a small C file that
> > calls this function and tried to compile it with GCC.
> >
> > I tried with just -lldap at first but I got a lot of undefined
> > references error, so I tried with -llber and I got only 2 undefined
> > references so I added -lresolv (since I recalled I had to add this in
> > the Makefile to compile Samba 2.2.X against OpenLDAP) and it worked. So
> > I'm thinking that the configure script in Samba doesn't link against all
> > those libraries so that's why it's saying that it doesn't find the LDAP
> > libraries.
> >
> > What are my options here? Is this an OpenLDAP issue or a Samba issue?
> >
> > Thanks
> >
> > Jean-Rene Cormier
> >
> >
> 
>