samba 3.0.0 compilation problem

Brandon Craig Rhodes brandon at
Wed Oct 29 07:30:36 GMT 2003

For some reason when samba-3.0.0's compiles smbd, it
lists some libraries before the $(LDFLAGS) variable:

bin/smbd at EXEEXT@: ...
	@$(CC) ... $(KRB5LIBS) $(LDAP_LIBS) $(LDFLAGS) ... <other libs> \
	  $(AUTH_LIBS) ... <other libs>

This means that, at least with Solaris make and cc, if your LDAP
libraries are in a non-standard place, they cannot be found - because
your LDFLAGS variable pointing at your ldap/lib directory with -L and
-R is reached on the command line only after the LDAP_LIBS have
already been searched for and not found.

Actually the story is even a bit odder: if ./configure discovers that
ldap is present, the options -llber and -lldap get placed both in the
LDAP_LIBS and in the AUTH_LIBS!  So in the situation described above,
it is only their first mention on the command line that produces an
error; the second time they are mentioned, ld finds them successfully.
The fact that they were missing earlier is still sufficient cause for
ld to die with an error, however.

Since the libraries were doubly mentioned, removing the $(LDAP_LIBS)
allowed me to complete my compile.

Brandon Craig Rhodes               
Georgia Tech                                            brandon at

More information about the samba-technical mailing list