free-wheeling / freewheeling

Freewheeling Live Looper
http://freewheeling.sourceforge.net/
GNU General Public License v2.0
105 stars 8 forks source link

Build of 0.6.5 fails with error: "FALSE was not declared in this scope" #16

Closed GvMariani closed 4 years ago

GvMariani commented 4 years ago

This is the command line: g++ -DPACKAGE_NAME=\"fweelin\" -DPACKAGE_TARNAME=\"fweelin\" -DPACKAGE_VERSION=\"0.6.5\" -DPACKAGE_STRING=\"fweelin\ 0.6.5\" -DPACKAGE_BUGREPORT=\"https://github.com/free-wheeling/freewheeling/issues\" -DPACKAGE_URL=\"\" -DPACKAGE=\"fweelin\" -DVERSION=\"0.6.5\" -DHAVE_LIBNETTLE=1 -DHAVE_LIBDL=1 -DHAVE_LIBFREETYPE=1 -DHAVE_LIBSDL_GFX=1 -DCAPITAL_FILLED_PIE=1 -DHAVE_LIBSDL_TTF=1 -DHAVE_LIBLO=1 -DHAVE_LIBXML2=1 -DHAVE_LIBM=1 -DHAVE_LIBPTHREAD=1 -DHAVE_LIBASOUND=1 -DHAVE_LIBJACK=1 -DUSE_FLUIDSYNTH=1 -DHAVE_LIBVORBIS=1 -DHAVE_LIBVORBISFILE=1 -DHAVE_LIBVORBISENC=1 -DHAVE_LIBOGG=1 -DHAVE_LIBSNDFILE=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_ERRNO_H=1 -DHAVE_FCNTL_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_LIMITS_H=1 -DHAVE_STDINT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_SYS_RESOURCE_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_TERMIOS_H=1 -DHAVE_UNISTD_H=1 -DHAVE_UTIME_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE__BOOL=1 -DHAVE_ALLOCA_H=1 -DHAVE_ALLOCA=1 -DHAVE_FORK=1 -DHAVE_VFORK=1 -DHAVE_WORKING_VFORK=1 -DHAVE_WORKING_FORK=1 -DHAVE_STDLIB_H=1 -DHAVE_MALLOC=1 -DHAVE_ATEXIT=1 -DHAVE_DUP2=1 -DHAVE_FLOOR=1 -DHAVE_GETTIMEOFDAY=1 -DHAVE_MEMSET=1 -DHAVE_POW=1 -DHAVE_REALPATH=1 -DHAVE_SELECT=1 -DHAVE_SQRT=1 -DHAVE_STRCASECMP=1 -DHAVE_STRCHR=1 -DHAVE_STRNCASECMP=1 -DHAVE_STRRCHR=1 -DHAVE_STRTOL=1 -I. -O2 -Wa,--compress-debug-sections -gdwarf-4 -fvar-tracking-assignments -frecord-gcc-switches -Wstrict-aliasing=2 -pipe -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -ffat-lto-objects -fno-delete-null-pointer-checks -fstack-protector --param=ssp-buffer-size=4 -fPIC -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/SDL -O2 -Wa,--compress-debug-sections -gdwarf-4 -fvar-tracking-assignments -frecord-gcc-switches -Wstrict-aliasing=2 -pipe -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -ffat-lto-objects -fno-delete-null-pointer-checks -fstack-protector --param=ssp-buffer-size=4 -fPIC -std=gnu++11 -I. -g -Wall -Wextra -Wno-write-strings -D_REENTRANT -DPTHREADS -DNDEBUG -DVERSION=\"0.6.5\" -DFWEELIN_DATADIR=\"/usr/share/fweelin\" -DADDON_DIR=\"/usr/local/lib/jack\" -I/usr/include/freetype2 -I/usr/include/libxml2 -funroll-loops -finline-functions -fomit-frame-pointer -ffast-math -fexpensive-optimizations -fstrict-aliasing -falign-loops=2 -falign-jumps=2 -falign-functions=2 -O9 -Wno-non-virtual-dtor -O2 -Wa,--compress-debug-sections -gdwarf-4 -fvar-tracking-assignments -frecord-gcc-switches -Wstrict-aliasing=2 -pipe -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -ffat-lto-objects -fno-delete-null-pointer-checks -fstack-protector --param=ssp-buffer-size=4 -fPIC -std=gnu++11 -MT fweelin_fluidsynth.o -MD -MP -MF $depbase.Tpo -c -o fweelin_fluidsynth.o fweelin_fluidsynth.cc &&\ mv -f $depbase.Tpo $depbase.Po

... and this the result: fweelin_fluidsynth.cc: In constructor 'FluidSynthProcessor::FluidSynthProcessor(Fweelin*, char)': fweelin_fluidsynth.cc:90:72: error: 'FALSE' was not declared in this scope fluid_synth_activate_octave_tuning(synth, 0, 0, "DETUNE", pitches, FALSE); ^ make[1]: *** [Makefile:451: fweelin_fluidsynth.o] Error 1 make[1]: *** Waiting for unfinished jobs.... make[1]: Leaving directory '/tmp/abf/rpmbuild/BUILD/freewheeling-0.6.5/src' make: *** [Makefile:348: all-recursive] Error 1

This is caused by the use of "FALSE" (and "TRUE") in c++ code: the corresponding keywords in c++ are all lowercase. This mean that commit 18e98443616ced116ca26c90ab0f4b3ce8e6a453 is not correct.

The issue can easily solved by putting a "#define FALSE 0" (or "false") and "#define TRUE 1" (or "true") somewhere; or by replacing the instances of FALSE/TRUE with the "regular" keywords in all the c++ source files. I choose the first solution and put the above #defines in fweelin_fluidsynth.h.

bill-auger commented 4 years ago

freewheeling builds fine for me on parabola/arch with GCC 9.2.1

you are correct o/c - that it is a c++ file - those constants should be changed - thanks for pointing it out

send a PR if you like - i got bunch of new compiler warnings - i suppose it is time for another round of maintenance

bill-auger commented 4 years ago

v0.6.6 fixes this