Klang: no characters found. cocos2d mac

When I compile my macOS cocos2d 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) 
+7
source share
2 answers

You need to add the libz.dylib library to your target.

As in Xcode 4.6, it is very simple. The final task screen allows you to add and remove frameworks and libraries. Here is a demo:

Adding a library to a target in Xcode 4.6 and later

+39
source

Open the target build settings. Find the Other linker flags option . Add the -lz flag to it.

You do not need to add libz.dylib as a framework, as Rob suggests, although this works too.

+22
source

All Articles