GameTechDev / ISPCTextureCompressor

ISPC Texture Compressor
MIT License
437 stars 97 forks source link

Compile error on Ubuntu 16.04: ‘numeric_limits’ is not a member of ‘std’ #30

Closed ghost closed 3 years ago

ghost commented 3 years ago

Ubuntu 16.04, GCC (Ubuntu 5.4.0-6ubuntu1~16.04.12) 5.4.0 20160609, ispc v1.9.2

g++ -O2 -msse2 -fPIC -I. -c ispc_texcomp/ispc_texcomp_astc.cpp -o ispc_texcomp/ispc_texcomp_astc.o
ispc_texcomp/ispc_texcomp_astc.cpp: In function ‘void CompressBlocksASTC(const rgba_surface*, uint8_t*, astc_enc_settings*)’:
ispc_texcomp/ispc_texcomp_astc.cpp:513:45: error: ‘numeric_limits’ is not a member of ‘std’
         block_scores[yy * tex_width + xx] = std::numeric_limits<float>::infinity();
                                             ^
ispc_texcomp/ispc_texcomp_astc.cpp:513:65: error: expected primary-expression before ‘float’
         block_scores[yy * tex_width + xx] = std::numeric_limits<float>::infinity();
                                                                 ^
Makefile.linux:49: recipe for target 'ispc_texcomp/ispc_texcomp_astc.o' failed
ghost commented 3 years ago

Would be really neat to have pre-compiled ISPCTextureCompressor binaries in cases like this...

ghost commented 3 years ago

Adding

#include <limits>

to ispc_texcomp/ispc_texcomp_astc.cpp solves it.

ghost commented 3 years ago

Compiled libispc_texcomp.so for Ubuntu 16.04: https://github.com/procedural/img2ktx_binaries_ubuntu_16_04/blob/master/third_party/ISPCTextureCompressor/build/libispc_texcomp.so

DaveBookout-Intel commented 3 years ago

thanks @procedural.