libZ and libz

Paolo Calafiura (Paolo.Calafiura@cern.ch)
Wed, 04 Mar 1998 22:21:31 +0100


Hi rooters,
I am writing an application that read an XDR-based DST and
"translates" it into a root tree. I have been fighting against
misterious crashes till I realized that the definitions of "inflate" and
"deflate" functions in the z library were not the same in root libZip
(int inflate(void)) and in libz.a version 1.0.4 used by the XDR
distribution (int inflate(z_stream, int)), which is, as far as I can
tell, more recent(1996). What happens then, is that the linker takes the
libz.a definition of inflate and the program either bombs (on a Sun) or
produces crap (on a SGI).
I can think of two solutions to this clash:
1) one pulls the gzip routines out of root libraries
(and so use whatever version of libz.a become available)
2) if we are happy to use inside libZip.so the current (1994) frozen
version of
inflate, deflate etc, one should "namespace" them e.g. calling them
ROOT_inflate, ROOT_deflate...

In the meanwhile I would appreciate any suggestion for a workaround,
short of doing myself the renaming :-)
Paolo