GameTechDev/ISPCTextureCompressor

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

Opened this issue · 4 comments

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

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

Adding

#include <limits>

to ispc_texcomp/ispc_texcomp_astc.cpp solves it.