Integration Issue of Tango SDK with Cocos2dx 3.0 based game [libpng error: bad parameters to zlib]

Atm, I am integrating Tango’s SDK with my game, built with Cocos2dx 3.0, and I encountered this issue where XCode’s console printed “libpng error: bad parameters to zlib”. Initial tracing of the error showed that a function call in CCImage.cpp, png_read_update_info, terminated prematurely when initialising a png file, resulting in a bad excess error when SpriteBatchNode attempts to add a spritesheet to cache as the texture was not initialised successfully. Furthermore, the one of the lib files in the SDK was found to contain a zlib file.

What exactly is the cause of this issue, usage of multiple zlib? Ultimately, is there anyway to solve this issue on my part, or Tango has to do something about their SDK?

It seems you are linking cocos2d-x with an incompatible zlib.

Yes. Or multiple libpngs.

You have to link Tango with their provided libpng/zlib, but cocos2d-x with the libpng/zlib it is compatible with. Link them statically not dynamically and they will use the correct code they need.

If you are linking dynamically, make sure both SDKs use a compatible libpng/zlib.