I was building our package on a Solaris 2.6 machine and ended up with:
ld: fatal: library -lz: not found
On this machine libz is in /usr/local/lib.
Running truss shows:
open("/usr/ccs/lib/libz.so", O_RDONLY) Err#2 ENOENT
open("/usr/ccs/lib/libz.a", O_RDONLY) Err#2 ENOENT
open("/usr/lib/libz.so", O_RDONLY) Err#2 ENOENT
open("/usr/lib/libz.a", O_RDONLY) Err#2 ENOENT
ld: write(2, " l d : ", 4) = 4
fatal: write(2, " f a t a l : ", 7) = 7
library -lwrite(2, " l i b r a r y - l", 10) = 10
zwrite(2, " z", 1) = 1
: not foundwrite(2, " : n o t f o u n d", 11) = 11
So it's not looking in /usr/local/lib.
So my question is why is configure finding libz?
I looked at our configure.in and we have the following (which now seems
overly complicated and doesn't need to take an argument). But I'm
curious why or how autoconf was able to link without an error.
dnl if withval not no or and not yes
if test "$withval" != "no" -a "$withval" != "yes"; then
Z_DIR=$withval
CPPFLAGS="${CPPFLAGS} -I$withval/include"
LDFLAGS="${LDFLAGS} -L$withval/lib"
fi
dnl if withval is maybe
if test "$withval" = "maybe"; then
withval="yes"
Z_DIR=""
CPPFLAGS="${CPPFLAGS}"
LDFLAGS="${LDFLAGS}"
fi
dnl if withval not no then try to enable zlib support
if test "$withval" != "no"; then
AC_CHECK_HEADERS(zlib.h,
AC_CHECK_LIB(z, gzread,[
AC_DEFINE(HAVE_ZLIB,[],[Do we have zlib])
if test "x${Z_DIR}" != "x"; then
Z_CFLAGS="-I${Z_DIR}/include"
Z_LIBS="-L${Z_DIR}/lib -lz"
else
Z_LIBS="-lz"
fi]))
AC_SUBST(Z_CFLAGS)
AC_SUBST(Z_LIBS)
else
AC_MSG_RESULT([Not building with zlib for property compression - use --with-zlib
to enable])
fi
--
Bill Moseley
[EMAIL PROTECTED]