Thursday, August 9, 2018

Zlib and Genromfs Fixes

I had been having some issues with zlib and genromfs lately, and I wanted to share my fixes in case anyone else ran into these issues.

Zlib: zlib_getlength was not declared in this scope

Some of the examples in the kos/examples/dreamcast folder use the library zlib for compression (notably: kos/examples/dreamcast/png). Likewise, some of the tutorials on DCEmu recommend/use it. Unfortunately, an update to zlib seems to have broken some functionality. Trying to use commands outlined in kos-ports/zlib/files/kos_zlib.c don't seem to really work (notably: zlib_getlength). I'm not sure if it's not compiling the *.c file, or if something is broken in the newer versions of zlib.

The rough fix for this I found was to copy kos_zlib.c and paste it into my project directory, then add
#include "kos_zlib.c"
to the top of any file that uses the two functions listed there.

This seems to have worked for me.

Genromfs

If you're using MSYS2, you might have an issue where genromfs generates an error when compiling. What I did was replace the kos/utils/genromfs folder with a new one from the git repo. Go to kos/utils, delete/rename your old genromfs folder, then use the command:
git clone https://github.com/chexum/genromfs
Then switch over from MINGW32 to MSYS2, and run the command
make install
in the genromfs folder

Hopefully that fixes the issue!

No comments:

Post a Comment