I use an open-source rendering library (Ogre3D) which has a dependency on zlib.
In XCode5, I noticed that when building for iOS, zlib will not build if 64-bit (arm64) architecture is indicated by ARCHS setting.
I get errors about "implicit function declaration" relating to LSEEK
macro, read
and write
functions. I looked up LSEEK
in gzlib.c:
#if defined(_WIN32) && !defined(__BORLANDC__)
# define LSEEK _lseeki64
#else
#if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0
# define LSEEK lseek64
#else
# define LSEEK lseek
#endif
#endif
My guess is something here is wrong, but I don't know what. And as for read()
and write()
I have no clue.
Try adding an #include <unistd.h>
in gzguts.h.
The easiest solution in that scenario is not to build zlib yourself at all, since it already comes pre-compiled with the iOS SDK (also for arm64).
This latest commit fixes it also in the official Ogre dependencies repository.
Apart from that, there is this other option from this Ogre3D thread:
With ARCHS = ARCHS_STANDARD_INCLUDING_64_BIT, projects like zlip were failing. When I changed this to ARCHS_STANDARD_32_64_BIT, they built OK. I've discovered the former evaluates to "armv7 armv7s arm64" while the latter currently evaluates to "armv7 armv7s". So I think zlip won't build for arm64.
That would mean that Ogre3D parts are compiled for 64-bit, where as some dependencies such as zlib stay 32-bit.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With