Xcode throws compile errors in zlib.h

1.5k views Asked by At

I get a bunch of errors in zlib.h about unknown type names, such as z_const and z_crc_t. Guessing there may be some file (where they are defined) not being included.

Why am I including zlib.h? I need to include minizip in my project but it in-turn includes zlib.h

zlib version: 1.2.8

2

There are 2 answers

0
kenorb On

Turned out, I had renamed zlib.h in the SDK directory (at some point) as well. Renamed it back and now Xcode finds zconf.h in the local directory. Absurd absurd absurd. Stupid Xcode. Oh well, it works.

@Ash

0
kenorb On

Change your include directories settings so that the one where zlib is comes first.

Or how about removing the wrong zlib.h? Make a copy somewhere so you can restore it if you ever need to.

Or better check: How to set include path in xcode project which is about changing the include paths to make sure you don't have to use hack like this.

@meneldal