xcode Clang:未找到符号。cocos2d mac
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8768224/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 22:55:49 来源:igfitidea点击:
Clang: symbols not found. cocos2d mac
提问by JqueryToAddNumbers
When i compile my cocos2d mac project i get this error:
当我编译我的 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)
回答by rob mayoff
回答by LearnCocos2D
Open your target's Build Settings. Locate the Other Linker Flagssetting. Add the -lzflag to it.
打开目标的构建设置。找到其他链接器标志设置。向其中添加-lz标志。
You don't need to add the libz.dylib as a framework as Rob suggests, although that works too.
您不需要像 Rob 建议的那样将 libz.dylib 添加为框架,尽管这也可以。