I'm trying to use the JUCE_INCLUDE_ZLIB_CODE define to use a different Zlib library. Unfortunately, I can't seem to make this work, even with a new project (created from 3.1.1) as a test. Here is what I did:
- Create new GUI application
- Set flag to disable including the JUCE zlib code
- Included source code and headers to project from latest zlib build
- Set JUCE_ZLIB_INCLUDE_PATH to find new zlib.h
Tried to compile but get the following error:
JuceLibraryCode/modules/juce_core/zip/juce_GZIPDecompressorInputStream.cpp:129:33: Unknown type name 'z_uInt'; did you mean 'uInt'?
- Set #define Z_PREFIX in zconf.h to avoid the error
I then get the error from zconf.h:
/Libraries/zlib/zconf.h:380:12: Unknown type name 'z_Byte'; did you mean 'Byte'?
I thought this might have something to do with the 'hack' mentioned by Jules in the zconf.h included with Juce.
- So I added #undef __MACTYPES__ to zconf.h
- I then start getting a ton of errors in the libpng libraries.
/JuceLibraryCode/modules/juce_graphics/image_formats/pnglib/pngwutil.c:521:32: Assigning to 'z_Bytef *' (aka 'unsigned char *') from incompatible type 'png_const_bytep' (aka 'const unsigned char *')
Just wondering if you have any hints of what could be causing this. I'm pretty close to giving up and rather fixing the issue on my real project which is having conflict with another library which is including zlib (which also uses the Z_PREFIX define, which is I guess why its not so easy to isolate).