Skip to content

Compiling without libGME fails

Compiling the master branch with make NOGME=1 (full build command being make -C src LINUX64=1 NOGME=1 NOUPX=1) fails because zlib symbols are unknown.

Adding the appropriate ifdefs around get_zlib_error function in src/sdl/mixer_sound.c solves the issue.

diff --git a/src/sdl/mixer_sound.c b/src/sdl/mixer_sound.c
index ef34b266d..3155a628f 100644
--- a/src/sdl/mixer_sound.c
+++ b/src/sdl/mixer_sound.c
@@ -220,6 +220,8 @@ static void var_cleanup(void)
        internal_volume = 100;
 }
 
+#ifdef HAVE_LIBGME
+#ifdef HAVE_ZLIB
 static const char* get_zlib_error(int zErr)
 {
        switch (zErr)
@@ -240,6 +242,8 @@ static const char* get_zlib_error(int zErr)
                        return "unknown error";
        }
 }
+#endif
+#endif
 
 /// ------------------------
 /// Audio System