Path to zlib header (DEF-3904)

Hi!

I’m working on ne using zlib and i have issue with including zlib header. On Mac
#include <zlib.h>
works fine, but on win I get error “file not found”.
So i’d like to ask is there a platform-independent way to include the header of zlib which engine uses?

1 Like

Currently there is no support for deflate/inflate in the DefoldSDK.
We do however have a Lua module that does this: zlib

What is you current use csae?

I use it to compress\decompress gzip. As a workaround i downloaded latest version of zlib headers and put into src folder in ne(#include “zlib.h”). Project builds and seems to work correctly, but it is not solution i’d like to use in a long term.

Your zlib module must be using zlib.h, but include path of that header seems to be different on windows/mac, can you check what are they?

No, it’s the same (internal) header. If you’re able to use an external header, then it’s a slippery slope, since that might not be the same version as the one we use.
You can ofc use your own implementation, but then be wary of symbol clashes, i.e. you’d have to rename your functions to not collide with ours.
The solution could be to add zlib.h to our sdk.h, but that’s not very high on our list so ETA unknown. Add ticket DEF-3904 for this.

3 Likes