When i compile my cocos2d mac project i get this error:
Undefined symbols for architecture x86_64:
"_inflateInit2_", referenced from:
_ccInflateMemoryWithHint in ZipUtils.o
"_inflate", referenced from:
_ccInflateMemoryWithHint in ZipUtils.o
"_inflateEnd", referenced from:
_ccInflateMemoryWithHint in ZipUtils.o
"_gzopen", referenced from:
_ccInflateGZipFile in ZipUtils.o
"_gzread", referenced from:
_ccInflateGZipFile in ZipUtils.o
"_gzclose", referenced from:
_ccInflateGZipFile in ZipUtils.o
"_uncompress", referenced from:
_ccInflateCCZFile in ZipUtils.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
You need to add the libz.dylib library to your target.
As of Xcode 4.6, this is very easy. The target summary screen lets you add and remove frameworks and libraries. Here's a demonstration:
Open your target's Build Settings. Locate the Other Linker Flags setting. Add the -lz flag to it.
You don't need to add the libz.dylib as a framework as Rob suggests, although that works too.
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