widelands / widelands

Widelands is a free, open source real-time strategy game with singleplayer campaigns and a multiplayer mode. The game was inspired by Settlers II™ (© Bluebyte) but has significantly more variety and depth to it.
https://www.widelands.org/
GNU General Public License v2.0
1.98k stars 150 forks source link

Compilation error on Fedora 40: error: "MZ_COMPAT_VERSION" is not defined #6473

Open tbellembois opened 6 days ago

tbellembois commented 6 days ago

Describe the bug

I have tried to compile widelands both from the latest git commit and from the lastest stable zip. I encounter the following issue: "MZ_COMPAT_VERSION" is not defined

To reproduce Steps to reproduce the behavior:

  1. git clone the repository
  2. ./install-dependencies.sh
  3. ./compile.sh

Expected behavior

Compilation success.

Crash log

[ 69%] Building CXX object src/io/filesystem/CMakeFiles/io_filesystem.dir/zip_filesystem.cc.o
In file included from /usr/include/minizip/unzip.h:10,
                 from /home/thbellem/Downloads/widelands-master/src/io/filesystem/zip_filesystem.h:24,
                 from /home/thbellem/Downloads/widelands-master/src/io/filesystem/zip_filesystem.cc:19:
/usr/include/minizip/mz_compat.h:123:5: error: "MZ_COMPAT_VERSION" is not defined, evaluates to 0 [-Werror=undef]
  123 | #if MZ_COMPAT_VERSION <= 110
      |     ^~~~~~~~~~~~~~~~~
/home/thbellem/Downloads/widelands-master/src/io/filesystem/zip_filesystem.cc: In member function ‘virtual void ZipFilesystem::make_directory(const std::string&)’:
/home/thbellem/Downloads/widelands-master/src/io/filesystem/zip_filesystem.cc:369:87: error: ‘Z_BEST_COMPRESSION’ was not declared in this scope
  369 |                                      0, nullptr, 0, nullptr /* comment*/, Z_DEFLATED, Z_BEST_COMPRESSION,
      |                                                                                       ^~~~~~~~~~~~~~~~~~
/home/thbellem/Downloads/widelands-master/src/io/filesystem/zip_filesystem.cc:370:68: error: ‘Z_DEFAULT_STRATEGY’ was not declared in this scope
  370 |                                      0, -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY, nullptr, 0)) {
      |                                                                    ^~~~~~~~~~~~~~~~~~
/home/thbellem/Downloads/widelands-master/src/io/filesystem/zip_filesystem.cc: In member function ‘virtual void ZipFilesystem::write(const std::string&, const void*, size_t)’:
/home/thbellem/Downloads/widelands-master/src/io/filesystem/zip_filesystem.cc:454:87: error: ‘Z_BEST_COMPRESSION’ was not declared in this scope
  454 |                                      0, nullptr, 0, nullptr /* comment*/, Z_DEFLATED, Z_BEST_COMPRESSION,
      |                                                                                       ^~~~~~~~~~~~~~~~~~
/home/thbellem/Downloads/widelands-master/src/io/filesystem/zip_filesystem.cc:455:68: error: ‘Z_DEFAULT_STRATEGY’ was not declared in this scope
  455 |                                      0, -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY, nullptr, 0)) {
      |                                                                    ^~~~~~~~~~~~~~~~~~
/home/thbellem/Downloads/widelands-master/src/io/filesystem/zip_filesystem.cc: In member function ‘virtual StreamWrite* ZipFilesystem::open_stream_write(const std::string&)’:
/home/thbellem/Downloads/widelands-master/src/io/filesystem/zip_filesystem.cc:506:87: error: ‘Z_BEST_COMPRESSION’ was not declared in this scope
  506 |                                      0, nullptr, 0, nullptr /* comment*/, Z_DEFLATED, Z_BEST_COMPRESSION,
      |                                                                                       ^~~~~~~~~~~~~~~~~~
/home/thbellem/Downloads/widelands-master/src/io/filesystem/zip_filesystem.cc:507:68: error: ‘Z_DEFAULT_STRATEGY’ was not declared in this scope
  507 |                                      0, -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY, nullptr, 0)) {
      |                                                                    ^~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
gmake[2]: *** [src/io/filesystem/CMakeFiles/io_filesystem.dir/build.make:118: src/io/filesystem/CMakeFiles/io_filesystem.dir/zip_filesystem.cc.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
In file included from /usr/include/minizip/unzip.h:10,
                 from /home/thbellem/Downloads/widelands-master/src/io/filesystem/zip_filesystem.h:24,
                 from /home/thbellem/Downloads/widelands-master/src/io/filesystem/disk_filesystem.cc:54:
/usr/include/minizip/mz_compat.h:123:5: error: "MZ_COMPAT_VERSION" is not defined, evaluates to 0 [-Werror=undef]
  123 | #if MZ_COMPAT_VERSION <= 110
      |     ^~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
gmake[2]: *** [src/io/filesystem/CMakeFiles/io_filesystem.dir/build.make:76: src/io/filesystem/CMakeFiles/io_filesystem.dir/disk_filesystem.cc.o] Error 1
In file included from /usr/include/minizip/unzip.h:10,
                 from /home/thbellem/Downloads/widelands-master/src/io/filesystem/zip_filesystem.h:24,
                 from /home/thbellem/Downloads/widelands-master/src/io/filesystem/filesystem.cc:51:
/usr/include/minizip/mz_compat.h:123:5: error: "MZ_COMPAT_VERSION" is not defined, evaluates to 0 [-Werror=undef]
  123 | #if MZ_COMPAT_VERSION <= 110
      |     ^~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
gmake[2]: *** [src/io/filesystem/CMakeFiles/io_filesystem.dir/build.make:90: src/io/filesystem/CMakeFiles/io_filesystem.dir/filesystem.cc.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:15573: src/io/filesystem/CMakeFiles/io_filesystem.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2

Version:

bunnybot commented 6 days ago

Mirrored on Codeberg as #CB4835.

bunnybot commented 6 days ago

tothxaMirrored from Codeberg On Thu Jun 27 17:28:07 CEST 2024, Tóth András (tothxa) wrote:


It looks to me like a bug in fedora's version of minizip-ng that's already fixed upstream. The current version on github first checks whether it's defined at all: https://github.com/zlib-ng/minizip-ng/blame/fe5fedc365f7824ada0cf9a84fb79b30d5fc97a8/mz_compat.h#L123C60-L123C60