Linking with native zlib library


Hi, I have to link with both Juce and the native zlib library, and if I use juce GzipStreams I got some multiple definitions link errors for the _zlibCompileFlags and _zlibVersion symbols (g++, tiger 10.4.10).

The weird thing is that it does not happen on Linux, with a very similar configuration.

I tried to extend the ZLIB_PREFIX hack in zconf.h with:

#ifdef Z_PREFIX
#  define zlibVersion           z_zlibVersion
#  define zlibCompileFlags      z_zlibCompileFlags
// ...

which seems to solve the problem. I don’t know if this is the right fix though…


Sounds like a sensible fix to me. I’ll add something similar. Those functions aren’t needed by juce anyway.