[Fluxus] Compile error using GCC 6.1.1 (with patch)

Alain Kalker a.c.kalker at gmail.com
Fri Jul 22 08:29:47 PDT 2016


On Arch Linux, Racket 6.5, GCC 6.1.1, I'm getting the following error 
when trying to compile Fluxus:

g++ -o libfluxus/src/Noise.o -c -ggdb -pipe -Wall -O3 -ffast-math -Wno-
unused -fPIC -pthread -DFLUXUS_MAJOR_VERSION=0 -DFLUXUS_MINOR_VERSION=18 -
DRACKET_COLLECTS_LOCATION="\"/usr/share/racket/collects"\" -
DFLUXUS_COLLECTS_LOCATION="\"/usr/lib"\" -DDATA_LOCATION="\"/usr/share/
fluxus-018"\" -DGLSL -DMZ_PRECISE_GC -DNO_LO_ARG_SIZE_DECL -
D__LINUX_ALSASEQ__ -I/usr/local/include -I/usr/include -I/usr/local/
include/freetype2 -I/usr/include/freetype2 -I/usr/include/racket -I/home/
miki/pkg/maint/fluxus-git/src/libfluxus/src libfluxus/src/Noise.cpp
In file included from libfluxus/src/Noise.cpp:22:0:
libfluxus/src/Noise.h:22:45: error: 'constexpr' needed for in-class 
initialization of static data member 'const float 
Fluxus::Noise::PERLIN_MIN_AMPLITUDE' of non-integral type [-fpermissive]
   static const float PERLIN_MIN_AMPLITUDE = 0.001f;
                                             ^~~~~~
scons: *** [libfluxus/src/Noise.o] Error 1
scons: building terminated because of errors.

I believe this happens because GCC since version 6.1 and above have 
switched to using -std=c++14 as default, and the compile command above 
doesn't override this.

I've created this simple patch which makes the error go away, but I 
haven't tested for any negative impact. Fluxus starts okay.

Kind regards,

Alain

---[patch follows]---
>From eda9059db67d7da605b252ded8a627a7bf406116 Mon Sep 17 00:00:00 2001
From: Alain Kalker <a.c.kalker at gmail.com>
Date: Fri, 22 Jul 2016 15:38:15 +0200
Subject: [PATCH] Use constexpr

Fixes compile error on GCC 6.1 and above.
---
 libfluxus/src/Noise.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libfluxus/src/Noise.h b/libfluxus/src/Noise.h
index 56dde7a..3eb447a 100644
--- a/libfluxus/src/Noise.h
+++ b/libfluxus/src/Noise.h
@@ -19,7 +19,7 @@ class Noise
 		static const int PERLIN_ZWRAPB = 8;
 		static const int PERLIN_ZWRAP = 1 << PERLIN_ZWRAPB;
 		static const int PERLIN_SIZE = PERLIN_YWRAP * 
PERLIN_ZWRAP;
-		static const float PERLIN_MIN_AMPLITUDE = 0.001f;
+		static constexpr float PERLIN_MIN_AMPLITUDE = 0.001f;
 
 		static bool inited;
 		static float perlin[4096];
-- 
2.9.0




More information about the Fluxus mailing list