2004.03.10 10:25 "[Tiff] Compiling under OS X with ZIP_SUPPORT", by Peter

2004.03.10 14:23 "Re: [Tiff] Compiling under OS X with ZIP_SUPPORT", by Frank Warmerdam

I am trying to compile libtiff version 3.6.1 with ZIP_SUPPORT with latest OS X dev. tools (xcode 1.1) + OS 10.3.2, but it fail in the end. Here is the last part of the compile message,

/usr/bin/gcc -dynamiclib -undefined error \
   -install_name libtiff.dylib \
   -o libtiff.3.6.1.dylib  tif_aux.o tif_close.o tif_codec.o
tif_compress.o tif_color.o tif_dir.o tif_dirinfo.o tif_dirread.o
tif_dirwrite.o tif_dumpmode.o tif_error.o tif_extension.o tif_fax3.o
tif_fax3sm.o tif_getimage.o tif_jpeg.o tif_flush.o tif_luv.o tif_lzw.o
tif_next.o tif_ojpeg.o tif_open.o tif_packbits.o tif_pixarlog.o
tif_predict.o tif_print.o tif_read.o tif_swab.o tif_strip.o
tif_thunder.o tif_tile.o tif_unix.o tif_version.o tif_warning.o
tif_write.o tif_zip.o  \

/usr/bin/libtool: internal link edit command failed
ld: Undefined symbols:
make[1]: *** [DARWINdso] Error 1
make: *** [all] Error 2

I know this missing functions belongs to zib library and available as frameworks such as /usr/lib/libz.1.1.3.dylib. How do I modify the make file to link with the zip framework?


Was that really the whole link line? No libraries included at all? The libtiff configure script is supposed to try adding -lz if zip support is enabled and nothing else is provided in the config.site script.

The rule in Makefile.in seems to be:

      ${CC} -dynamiclib -undefined error \
      -install_name libtiff.@DSOSUF@ \
        -o libtiff.@DSOSUF_VERSION@  ${OBJS} \
       rm -f libtiff.@DSOSUF@
  if [ @DSOSUF_VERSION@ != @DSOSUF@ ] ; then \
      @LN@ @LN_S@ libtiff.@DSOSUF_VERSION@ libtiff.@DSOSUF@; \
      touch $@

This should include any jpeg, and libz library in the link command. The configure rules try to set LIBGZ if ZIP is enabled. Did you enable zip support by including it in config.site or just by adjusting tiffconf.h? If you just modify tiffconf.h then you will have to manually include the libz. Editing the expanded DARWINdso target in your libtiff-3.6.1/libtiff/Makefile to include -lz should fix the problem.

But the "proper" way of turning on zip support is to enable it in config.site by uncommenting the ZIP="yes" line. This sets things up so the configure can try to include the supporting library.

Best regards,

I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam@pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent