deathkiller / jazz2

🎮 · Jazz² Resurrection: Open-source reimplementation of Jazz Jackrabbit 2
https://deat.tk/jazz2/
GNU General Public License v3.0
495 stars 18 forks source link

Build Error. #142

Closed Zombie-Ryushu closed 3 months ago

Zombie-Ryushu commented 4 months ago

/home/masterz/testing/BUILD/jazz2-native/Sources/Main.cpp: In member function ‘virtual void GameEventHandler::OnPreInit(nCine::AppConfiguration&)’: /home/masterz/testing/BUILD/jazz2-native/Sources/Main.cpp:172:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (std::int32_t i = 0; i < config.argc() - 2; i++) { ^~~~~ /home/masterz/testing/BUILD/jazz2-native/Sources/Main.cpp: In function ‘int main(int, char*)’: /home/masterz/testing/BUILD/jazz2-native/Sources/Main.cpp:1732:28: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (std::size_t i = 1; i < argc; i++) { ^~~~ [ 32%] Building CXX object CMakeFiles/jazz2.dir/Sources/Jazz2/ContentResolver.cpp.o /home/masterz/testing/BUILD/jazz2-native/Sources/Jazz2/ContentResolver.cpp: In member function ‘Jazz2::Metadata Jazz2::ContentResolver::RequestMetadata(Death::Containers::StringView)’: /home/masterz/testing/BUILD/jazz2-native/Sources/Jazz2/ContentResolver.cpp:463:35: warning: unused variable ‘key’ [-Wunused-variable] for (const auto& [key, resource] : it->second->Sounds) { ^ /home/masterz/testing/BUILD/jazz2-native/Sources/Jazz2/ContentResolver.cpp: In member function ‘std::unique_ptr Jazz2::ContentResolver::RequestTileSet(Death::Containers::StringView, uint16_t, bool, const uint8_t*)’: /home/masterz/testing/BUILD/jazz2-native/Sources/Jazz2/ContentResolver.cpp:1119:39: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (tx + TileSet::DefaultTileSize <= width && ty + TileSet::DefaultTileSize <= height) {


/home/masterz/testing/BUILD/jazz2-native/Sources/Jazz2/ContentResolver.cpp:1119:81: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     if (tx + TileSet::DefaultTileSize <= width && ty + TileSet::DefaultTileSize <= height) {
                                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
/home/masterz/testing/BUILD/jazz2-native/Sources/Jazz2/ContentResolver.cpp: In member function ‘std::optional<Jazz2::Episode> Jazz2::ContentResolver::GetEpisodeByPath(Death::Containers::StringView, bool)’:
/home/masterz/testing/BUILD/jazz2-native/Sources/Jazz2/ContentResolver.cpp:1382:10: error: could not convert ‘episode’ from ‘Jazz2::Episode’ to ‘std::optional<Jazz2::Episode>’
   return episode;
deathkiller commented 4 months ago

It looks like too old compiler. Which compiler version do you have? Can you update it to the newer/latest version?

Zombie-Ryushu commented 4 months ago

I'm using gcc due to update alternatives. COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=/usr/lib64/gcc/x86_64-suse-linux/11/lto-wrapper OFFLOAD_TARGET_NAMES=nvptx-none OFFLOAD_TARGET_DEFAULT=1 Target: x86_64-suse-linux Configured with: ../configure --prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib64 --libexecdir=/usr/lib64 --enable-languages=c,c++,objc,fortran,obj-c++,ada,go,d --enable-offload-targets=nvptx-none, --without-cuda-driver --enable-checking=release --disable-werror --with-gxx-include-dir=/usr/include/c++/11 --enable-ssp --disable-libssp --disable-libvtv --enable-cet=auto --disable-libcc1 --disable-plugin --with-bugurl=https://bugs.opensuse.org/ --with-pkgversion='SUSE Linux' --with-slibdir=/lib64 --with-system-zlib --enable-libstdcxx-allocator=new --disable-libstdcxx-pch --enable-libphobos --enable-version-specific-runtime-libs --with-gcc-major-version-only --enable-linker-build-id --enable-linux-futex --enable-gnu-indirect-function --program-suffix=-11 --without-system-libunwind --enable-multilib --with-arch-32=x86-64 --with-tune=generic --build=x86_64-suse-linux --host=x86_64-suse-linux Thread model: posix Supported LTO compression algorithms: zlib gcc version 11.3.0 (SUSE Linux)

sudo update-alternatives --list gcc [sudo] password for masterz: /usr/bin/gcc-11 /usr/bin/gcc-7

deathkiller commented 4 months ago

I'm building it on GCC 9.4.0 and 11.4.0 in GitHub Actions, and works good on both of them. But I have no experience with OpenSuse. Hard to tell what's wrong there. Conversion to std::optional should be valid operation and works on all platforms that are used on GitHub Actions.

Zombie-Ryushu commented 4 months ago

I will have to check it on OpenSuse Build service.

deathkiller commented 3 months ago

Closing due to inactivity. Feel free to reopen if needed.