Cannot compile any projects anymore

Greetings,

I’m trying to compile my old projects again… the version of Panda3D is the same, but perhaps the compiler has been updated. I’m using gcc 5.2.0.

There seem to be some issue with uses of constexpr, check this out:

In file included from /usr/include/panda3d/convert_srgb.h:57:0,
                 from /usr/include/panda3d/pnmImage.h:23,
                 from /usr/include/panda3d/texture.h:43,
                 from /usr/include/panda3d/shaderInput.h:33,
                 from /usr/include/panda3d/nodePath.h:41,
                 from /usr/include/panda3d/windowFramework.h:19,
                 from /usr/include/panda3d/pandaFramework.h:21,
                 from /home/plaristote/Work/fallout-equestria/code/game/include/level/level.hpp:5,
                 from /home/plaristote/Work/fallout-equestria/code/game/include/gametask.hpp:5,
                 from /home/plaristote/Work/fallout-equestria/code/game/src/script_api.cpp:4:
/usr/include/panda3d/convert_srgb.I: In function 'constexpr float decode_sRGB_float(unsigned char)':
/usr/include/panda3d/convert_srgb.I:23:1: error: the value of 'to_linear_float_table' is not usable in a constant expression
 }
 ^
In file included from /usr/include/panda3d/pnmImage.h:23:0,
                 from /usr/include/panda3d/texture.h:43,
                 from /usr/include/panda3d/shaderInput.h:33,
                 from /usr/include/panda3d/nodePath.h:41,
                 from /usr/include/panda3d/windowFramework.h:19,
                 from /usr/include/panda3d/pandaFramework.h:21,
                 from /home/plaristote/Work/fallout-equestria/code/game/include/level/level.hpp:5,
                 from /home/plaristote/Work/fallout-equestria/code/game/include/gametask.hpp:5,
                 from /home/plaristote/Work/fallout-equestria/code/game/src/script_api.cpp:4:
/usr/include/panda3d/convert_srgb.h:27:54: note: 'to_linear_float_table' was not declared 'constexpr'
 extern EXPCL_PANDA_PNMIMAGE ALIGN_64BYTE const float to_linear_float_table[256];
                                                      ^
In file included from /usr/include/panda3d/convert_srgb.h:57:0,
                 from /usr/include/panda3d/pnmImage.h:23,
                 from /usr/include/panda3d/texture.h:43,
                 from /usr/include/panda3d/shaderInput.h:33,
                 from /usr/include/panda3d/nodePath.h:41,
                 from /usr/include/panda3d/windowFramework.h:19,
                 from /usr/include/panda3d/pandaFramework.h:21,
                 from /home/plaristote/Work/fallout-equestria/code/game/include/level/level.hpp:5,
                 from /home/plaristote/Work/fallout-equestria/code/game/include/gametask.hpp:5,
                 from /home/plaristote/Work/fallout-equestria/code/game/src/script_api.cpp:4:
/usr/include/panda3d/convert_srgb.I: In function 'constexpr unsigned char decode_sRGB_uchar(unsigned char)':
/usr/include/panda3d/convert_srgb.I:45:1: error: the value of 'to_linear_uchar_table' is not usable in a constant expression
 }
 ^
In file included from /usr/include/panda3d/pnmImage.h:23:0,
                 from /usr/include/panda3d/texture.h:43,
                 from /usr/include/panda3d/shaderInput.h:33,
                 from /usr/include/panda3d/nodePath.h:41,
                 from /usr/include/panda3d/windowFramework.h:19,
                 from /usr/include/panda3d/pandaFramework.h:21,
                 from /home/plaristote/Work/fallout-equestria/code/game/include/level/level.hpp:5,
                 from /home/plaristote/Work/fallout-equestria/code/game/include/gametask.hpp:5,
                 from /home/plaristote/Work/fallout-equestria/code/game/src/script_api.cpp:4:
/usr/include/panda3d/convert_srgb.h:26:62: note: 'to_linear_uchar_table' was not declared 'constexpr'
 extern EXPCL_PANDA_PNMIMAGE ALIGN_64BYTE const unsigned char to_linear_uchar_table[256];
                                                              ^
In file included from /usr/include/panda3d/convert_srgb.h:57:0,
                 from /usr/include/panda3d/pnmImage.h:23,
                 from /usr/include/panda3d/texture.h:43,
                 from /usr/include/panda3d/shaderInput.h:33,
                 from /usr/include/panda3d/nodePath.h:41,
                 from /usr/include/panda3d/windowFramework.h:19,
                 from /usr/include/panda3d/pandaFramework.h:21,
                 from /home/plaristote/Work/fallout-equestria/code/game/include/level/level.hpp:5,
                 from /home/plaristote/Work/fallout-equestria/code/game/include/gametask.hpp:5,
                 from /home/plaristote/Work/fallout-equestria/code/game/src/script_api.cpp:4:
/usr/include/panda3d/convert_srgb.I: In function 'constexpr unsigned char encode_sRGB_uchar(unsigned char)':
/usr/include/panda3d/convert_srgb.I:94:1: error: the value of 'to_srgb8_table' is not usable in a constant expression
 }
 ^
In file included from /usr/include/panda3d/pnmImage.h:23:0,
                 from /usr/include/panda3d/texture.h:43,
                 from /usr/include/panda3d/shaderInput.h:33,
                 from /usr/include/panda3d/nodePath.h:41,
                 from /usr/include/panda3d/windowFramework.h:19,
                 from /usr/include/panda3d/pandaFramework.h:21,
                 from /home/plaristote/Work/fallout-equestria/code/game/include/level/level.hpp:5,
                 from /home/plaristote/Work/fallout-equestria/code/game/include/gametask.hpp:5,
                 from /home/plaristote/Work/fallout-equestria/code/game/src/script_api.cpp:4:
/usr/include/panda3d/convert_srgb.h:25:62: note: 'to_srgb8_table' was not declared 'constexpr'
 extern EXPCL_PANDA_PNMIMAGE ALIGN_64BYTE const unsigned char to_srgb8_table[256];

Any clue what’s up with that ?

Which version of Panda3D are you trying to build? Those functions aren’t constexpr in the latest master version, nor are they constexpr in the latest release/1.9.x version.

Weird then. I installed it from AUR (aur4.archlinux.org/packages/panda3d/). They tagged this as 1.9.0-3.

I did clone panda3d repository at some point, so I’ll reinstall everything just to make sure that I have the right version installed. But I’m pretty sure I never installed the build I made from the git repository.

EDIT: yup, I reinstalled everything, and I still have the problem… I’ll compile from the release/1.9 branch and see if it still happens.

RE-EDIT: re-yup, I compiled and installed from the release/1.9 branch, and it fixed the issue with the constexpr things. I’d say it’s the packager’s fault, but the URL does look correct to me: panda3d.org/download/panda3d … 9.0.tar.gz

Well, 1.9.1 has just been released, so the package should probably be updated sooner or later.