bluescan / tacentview

An image and texture viewer for tga, png, apng, exr, dds, pvr, ktx, ktx2, astc, pkm, qoi, gif, hdr, jpg, tif, ico, webp, and bmp files. Uses Dear ImGui, OpenGL, and Tacent. Useful for game devs as it displays information like the presence of an alpha channel and querying specific pixels for their colour.
ISC License
377 stars 36 forks source link

[FIX] `# include <algorithm>` is needed: Build with GCC 14.1.1 fails with `tQuantizeSpatial.cpp:231:14: error: ‘shuffle’ is not a member of ‘std’` #172

Closed dreirund closed 5 months ago

dreirund commented 5 months ago

Trying to build latest release (version 1.0.44) on Artix GNU/Linux (rolling release) with up to date GCC version 14.1.1 fails with

[...]
[1/62] Building CXX object _deps/tacent-build/Modules/Image/CMakeFiles/Image.dir/Src/tQuantizeSpatial.cpp.o
FAILED: _deps/tacent-build/Modules/Image/CMakeFiles/Image.dir/Src/tQuantizeSpatial.cpp.o 
/usr/bin/c++ -DCONFIG_RELEASE -DPLATFORM_LINUX -I/var/cache/makepkg/build/tacentview/src/build/_deps/tacent-src/Modules/Image/Inc -I/var/cache/makepkg/build/tacentview/src/build/_deps/tacent-src/Modules/Image/Contrib -I/var/cache/makepkg/build/tacentview/src/build/_deps/tacent-src/Modules/Image/Contrib/TinyXML2 -I/var/cache/makepkg/build/tacentview/src/build/_deps/tacent-src/Modules/Image/Contrib/ZLib/include -I/var/cache/makepkg/build/tacentview/src/build/_deps/tacent-src/Modules/Image/Contrib/LibPNG/include -I/var/cache/makepkg/build/tacentview/src/build/_deps/tacent-src/Modules/Image/Contrib/LibSPNG -I/var/cache/makepkg/build/tacentview/src/build/_deps/tacent-src/Modules/Image/Contrib/ApngDis -I/var/cache/makepkg/build/tacentview/src/build/_deps/tacent-src/Modules/Image/Contrib/ApngAsm -I/var/cache/makepkg/build/tacentview/src/build/_deps/tacent-src/Modules/Image/Contrib/bcdec -I/var/cache/makepkg/build/tacentview/src/build/_deps/tacent-src/Modules/Image/Contrib/etcdec -I/var/cache/makepkg/build/tacentview/src/build/_deps/tacent-src/Modules/Image/Contrib/ASTCEncoder/include -I/var/cache/makepkg/build/tacentview/src/build/_deps/tacent-src/Modules/Image/Contrib/GifLoad -I/var/cache/makepkg/build/tacentview/src/build/_deps/tacent-src/Modules/Image/Contrib/gifenc -I/var/cache/makepkg/build/tacentview/src/build/_deps/tacent-src/Modules/Image/Contrib/LibKTX/include -I/var/cache/makepkg/build/tacentview/src/build/_deps/tacent-src/Modules/Image/Contrib/LibTIFF/include -I/var/cache/makepkg/build/tacentview/src/build/_deps/tacent-src/Modules/Image/Contrib/OpenEXR/include -I/var/cache/makepkg/build/tacentview/src/build/_deps/tacent-src/Modules/Image/Contrib/OpenEXR/include/OpenEXR -I/var/cache/makepkg/build/tacentview/src/build/_deps/tacent-src/Modules/Image/Contrib/TinyEXIF -I/var/cache/makepkg/build/tacentview/src/build/_deps/tacent-src/Modules/Image/Contrib/TurboJpeg -I/var/cache/makepkg/build/tacentview/src/build/_deps/tacent-src/Modules/Image/Contrib/TurboJpeg/Linux -I/var/cache/makepkg/build/tacentview/src/build/_deps/tacent-src/Modules/Image/Contrib/WebP/include -I/var/cache/makepkg/build/tacentview/src/build/_deps/tacent-src/Modules/Foundation/Inc -I/var/cache/makepkg/build/tacentview/src/build/_deps/tacent-src/Modules/Math/Inc -I/var/cache/makepkg/build/tacentview/src/build/_deps/tacent-src/Modules/System/Inc -O3 -DNDEBUG -std=gnu++20 -Wno-unused-result -Wno-stringop-overflow -Wno-multichar -Wno-switch -O2 -MD -MT _deps/tacent-build/Modules/Image/CMakeFiles/Image.dir/Src/tQuantizeSpatial.cpp.o -MF _deps/tacent-build/Modules/Image/CMakeFiles/Image.dir/Src/tQuantizeSpatial.cpp.o.d -o _deps/tacent-build/Modules/Image/CMakeFiles/Image.dir/Src/tQuantizeSpatial.cpp.o -c /var/cache/makepkg/build/tacentview/src/build/_deps/tacent-src/Modules/Image/Src/tQuantizeSpatial.cpp
/var/cache/makepkg/build/tacentview/src/build/_deps/tacent-src/Modules/Image/Src/tQuantizeSpatial.cpp: In function ‘void tImage::tQuantizeSpatial::random_permutation(int, std::vector<int>&, std::default_random_engine&)’:
/var/cache/makepkg/build/tacentview/src/build/_deps/tacent-src/Modules/Image/Src/tQuantizeSpatial.cpp:231:14: error: ‘shuffle’ is not a member of ‘std’
  231 |         std::shuffle(result.begin(), result.end(), randEng);
      |              ^~~~~~~
[18/62] Building CXX object _deps/tacent-build/Modules/Scene/CMakeFiles/Scene.dir/Src/tWorld.cpp.o
ninja: build stopped: subcommand failed.

A fix is given here; # include <algorithm> is needed.

Regards!

bluescan commented 5 months ago

Thx for the report. 19afdeb4b5a5336f24a53c830440b5f23c28f06f fixes by fetching the version of tacent that has the fix.