In my project I have several linking errors, each of them points to libz missing. Here is the example:
Undefined symbols for architecture arm64:
"_inflateReset2", referenced from:
_png_inflate_claim in libcocos2d iOS.a(pngrutil.o)
"_inflateEnd", referenced from:
cocos2d::unzCloseCurrentFile(void*) in libcocos2d iOS.a(unzip.o)
cocos2d::ZipUtils::inflateMemoryWithHint(unsigned char*, long, unsigned char**, long*, long) in libcocos2d iOS.a(ZipUtils.o)
_png_destroy_read_struct in libcocos2d iOS.a(pngread.o)
+[GAICompressionUtil gai_dataByInflatingBytes:length:isRawData:] in libGoogleAnalyticsServices.a(GAICompressionUtil.o)
_FT_Stream_OpenGzip in libcocos2d iOS.a(ftgzip.o)
_ft_gzip_stream_close in libcocos2d iOS.a(ftgzip.o)
_FT_Gzip_Uncompress in libcocos2d iOS.a(ftgzip.o)
...
"_deflate", referenced from:
+[GAICompressionUtil gai_dataByCompressingBytes:length:compressionLevel:mode:] in libGoogleAnalyticsServices.a(GAICompressionUtil.o)
"_deflateInit2_", referenced from:
+[GAICompressionUtil gai_dataByCompressingBytes:length:compressionLevel:mode:] in libGoogleAnalyticsServices.a(GAICompressionUtil.o)
"_inflateReset", referenced from:
_png_decompress_chunk in libcocos2d iOS.a(pngrutil.o)
_FT_Stream_OpenGzip in libcocos2d iOS.a(ftgzip.o)
_ft_gzip_file_io in libcocos2d iOS.a(ftgzip.o)
So looks like external libs (cocos2d & GA) can't find this lib. I have it in Link binary with libraries for my target, also have -lz
flag in Other Linger flags. Removing any of those keep this errors.
What can cause this problem? How this might be resolved?
(I've already tried things like restarting XCode, cleaning derived data, etc)