thejoshwolfe / legend-of-swarkland

Turn-based action fantasy puzzle game inspired by NetHack and Crypt of the Necrodancer
http://wolfesoftware.com/legend-of-swarkland/
Other
91 stars 5 forks source link

Weird error compiling #50

Closed bpsuntrup closed 5 years ago

bpsuntrup commented 6 years ago

From Ubuntu 16.04 LTS, I cloned the repository, installed the dependencies:

git submodule update --init --recursive
sudo apt-get install libsdl2-dev libsdl2-ttf-dev upx-ucl

and ran make. This produced the following output:

~/cpp/legend-of-swarkland$ make
g++ -c -std=c++14 -o build/native/display.o -MMD -MP -MF build/native/display.o.d -Ibuild/native/ -fsanitize=address -fno-omit-frame-pointer -fno-exceptions -fno-rtti -Ibuild/native -Isrc -g -Wall -Wextra -Werror -D_REENTRANT -I/usr/include/SDL2 src/display.cpp
src/display.cpp:784:20: error: enclosing class of constexpr non-static member function ‘bool StatusDisplay::operator==(const StatusDisplay&) const’ is not a literal type
     constexpr bool operator==(const StatusDisplay & other) const {
                    ^
src/display.cpp:768:8: note: ‘StatusDisplay’ is not literal because:
 struct StatusDisplay {
        ^
src/display.cpp:768:8: note:   ‘StatusDisplay’ is not an aggregate, does not have a trivial default constructor, and has no constexpr constructor that is not a copy or move constructor
src/display.cpp:787:20: error: enclosing class of constexpr non-static member function ‘bool StatusDisplay::operator!=(const StatusDisplay&) const’ is not a literal type
     constexpr bool operator!=(const StatusDisplay & other) const {
                    ^
Makefile:53: recipe for target 'build/native/display.o' failed
make: *** [build/native/display.o] Error 1
thejoshwolfe commented 6 years ago

hm. i think there might be a dependency on a more recent version of g++. what does g++ --version give you? For me it's:

$ g++ --version
g++ (Ubuntu 7.3.0-16ubuntu3) 7.3.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
bpsuntrup commented 6 years ago

Ah. I get the following: I'll have to look into why my compiler is two major versions behind yours.

$ g++ --version
g++ (Ubuntu 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.