[R] Configuration: libpng needs zlib, but ...

Thomas Hoffmann thoffman at zappa.sax.de
Sun Nov 18 21:37:38 CET 2001


I noticed that congigure reported libpng as "not found" although a
recent version exists.

Further looking into this issue told me, that the test failed because
the test
from R.m4

        AC_CHECK_LIB(png, png_create_write_struct, [
          BITMAP_LIBS="${BITMAP_LIBS} -lpng -lz"
          AC_DEFINE(HAVE_PNG)
        ], , ${LIBS})
      ], AC_MSG_RESULT([no]))
    ])

did fail:

gcc.exe -o conftest.exe -g -m486 -Zmt -Ig:/include -I/xfree86/include
-Zmt -Zcrtdll -Zsysv-signals conftest.c -lpng -lsocket -lreadline -ldl
-lncurses -lm -lcExt
g:\lib/png.a(pngwrite.o): Undefined symbol _deflateEnd referenced from
text segment
g:\lib/png.a(pngwrite.o): Undefined symbol _deflate referenced from text
segment
g:\lib/png.a(png.o): Undefined symbol _inflateReset referenced from text
segment
g:\lib/png.a(png.o): Undefined symbol _crc32 referenced from text
segment
g:\lib/png.a(png.o): Undefined symbol _crc32 referenced from text
segment
......

This is because zlib is not included in the command line (-lz). And this
has to do
with the order of calls in configure in: libz is looked for AFTER the
bitmap libs, so it 
is not in $(LIBS) yet:

......
## Bitmap headers and libraries.
R_BITMAPS

## XDR headers and library routines.
R_XDR

## zlib headers and libraries.
R_ZLIB

## POSIX times.
R_USES_LEAPSECONDS
......

I think either the order in configure.in should be changed or in R.m4
the zlib 
should be included into the OTHER-LIBRARIES branch of the macro.

-- 
Thomas Hoffmann                                    Telephone:
49-351-4598831
thoffman at zappa.sax.de                                       Dresden,
Germany

..sig under construction ...
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list