0

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

Ash
  • 2,021
  • 2
  • 26
  • 59
  • So I noticed what's causing this issue but not sure how to solve it. Those symbols are defined in `zconf.h` and are new in version 1.2.8 but the `#include zconf.h` in `zlib.h` points to the file in `/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/include/` and not the one in the same directory as `zlib.h` itself. – Ash Jun 12 '15 at 03:39
  • Change your include directories settings so that the one where `zlib` is comes first. – meneldal Jun 12 '15 at 03:50
  • Not sure how to do that. Xcode looks in the sdk directory automatically. Under 'Search Paths', I only see the local directory from where I'm including `zlib.h` – Ash Jun 12 '15 at 05:33
  • 1
    How about removing the wrong `zlib.h`? (make a copy somewhere so you can restore it if you ever need to) – meneldal Jun 12 '15 at 06:06
  • Yea that makes it compile, but just seems like a real hack. Another thing is, Xcode complains saying 'Symbol not found' when I right click on `#include "zconf.h` in `zlib.h` even though they are in the same directory and moreover, it compiles!?? – Ash Jun 12 '15 at 06:48
  • You might find some more information here http://stackoverflow.com/questions/14134064/how-to-set-include-path-in-xcode-project about changing the include paths to make sure you don't have to use hack like this. – meneldal Jun 12 '15 at 06:51
  • Ok, so made progress. 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 Jun 12 '15 at 07:05

2 Answers2

0

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

Community
  • 1
  • 1
kenorb
  • 155,785
  • 88
  • 678
  • 743
0

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

Community
  • 1
  • 1
kenorb
  • 155,785
  • 88
  • 678
  • 743