当我编译cocos2d mac项目时,会出现以下错误:
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)
最佳答案
您需要将libz.dylib库添加到目标中。
从xcode 4.6开始,这非常简单。目标汇总屏幕允许您添加和删除框架和库。下面是演示: