endless-sky / endless-sky-editor

Map editor for the Endless Sky universe.
GNU General Public License v3.0
68 stars 44 forks source link

Build fails. #15

Closed kaiser-dg closed 6 years ago

kaiser-dg commented 7 years ago

After running qmake, make returns a compiler error. Log: g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -o main.o main.cpp In file included from main.cpp:13:0: MainWindow.h:63:5: warning: identifier ‘nullptr’ is a keyword in C++11 [-Wc++0x-compat] QTabWidget *tabs = nullptr; ^ MainWindow.h:50:48: warning: override controls (override/final) only available with -std=c++11 or -std=gnu++11 virtual void keyPressEvent(QKeyEvent *event) override; ^ MainWindow.h:51:47: warning: override controls (override/final) only available with -std=c++11 or -std=gnu++11 virtual void closeEvent(QCloseEvent *event) override; ^ MainWindow.h:52:55: warning: override controls (override/final) only available with -std=c++11 or -std=gnu++11 virtual void dragEnterEvent(QDragEnterEvent *event) override; ^ MainWindow.h:53:45: warning: override controls (override/final) only available with -std=c++11 or -std=gnu++11 virtual void dropEvent(QDropEvent *event) override; ^ MainWindow.h:63:24: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 QTabWidget *tabs = nullptr; ^ MainWindow.h:64:30: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 DetailView *detailView = nullptr; ^ MainWindow.h:65:30: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 GalaxyView *galaxyView = nullptr; ^ MainWindow.h:66:30: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 SystemView *systemView = nullptr; ^ MainWindow.h:67:30: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 PlanetView *planetView = nullptr; ^ MainWindow.h:69:25: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 QMenu *galaxyMenu = nullptr; ^ MainWindow.h:70:25: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 QMenu *systemMenu = nullptr; ^ MainWindow.h:63:24: error: ‘nullptr’ was not declared in this scope QTabWidget *tabs = nullptr; ^ MainWindow.h:64:30: error: ‘nullptr’ was not declared in this scope DetailView *detailView = nullptr; ^ MainWindow.h:65:30: error: ‘nullptr’ was not declared in this scope GalaxyView *galaxyView = nullptr; ^ MainWindow.h:66:30: error: ‘nullptr’ was not declared in this scope SystemView *systemView = nullptr; ^ MainWindow.h:67:30: error: ‘nullptr’ was not declared in this scope PlanetView *planetView = nullptr; ^ MainWindow.h:69:25: error: ‘nullptr’ was not declared in this scope QMenu *galaxyMenu = nullptr; ^ MainWindow.h:70:25: error: ‘nullptr’ was not declared in this scope QMenu *systemMenu = nullptr; ^ In file included from Map.h:17:0, from main.cpp:14: Planet.h:111:72: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 double requiredReputation = std::numeric_limits<double>::quiet_NaN(); ^ Planet.h:112:59: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 double bribe = std::numeric_limits<double>::quiet_NaN(); ^ Planet.h:113:62: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 double security = std::numeric_limits<double>::quiet_NaN(); ^ Planet.h:115:61: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 double tribute = std::numeric_limits<double>::quiet_NaN(); ^ Planet.h:116:70: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 double tributeThreshold = std::numeric_limits<double>::quiet_NaN(); ^ Planet.h:117:74: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 double tributeFleetQuantity = std::numeric_limits<double>::quiet_NaN(); ^ In file included from System.h:16:0, from Map.h:18, from main.cpp:14: StellarObject.h:89:23: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 double distance = 0.; ^ StellarObject.h:90:21: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 double period = 0.; ^ StellarObject.h:91:21: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 double offset = 0.; ^ StellarObject.h:92:19: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 int parent = -1; ^ In file included from Map.h:18:0, from main.cpp:14: System.h:131:10: error: ‘map’ in namespace ‘std’ does not name a template type std::map<QString, int> trade; ^ In file included from main.cpp:14:0: Map.h:72:30: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 mutable bool isChanged = false; ^ make: *** [Makefile:282: main.o] Error 1 I am using Gentoo under AMD64.

endless-sky commented 7 years ago

It sound like you're not running the compiler in c++11 mode, either because it's too old a compiler or because you haven't added the right compile switch. (Have you tried building in Qt Creator? The .pro file specifies config += c++11.)

kaiser-dg commented 6 years ago

I just tried compiling in QTCreator. Same issue.

endless-sky commented 6 years ago

What g++ version are you using? It might be something too old to support c++11.

kaiser-dg commented 6 years ago

gcc version 5.4.0 (Gentoo 5.4.0-r3 p1.3, pie-0.6.5)

kaiser-dg commented 6 years ago

UPDATE: I forgot to mention that when compiling with -std=c++11 removes most errors except for 'map' in namespace 'std' does not name a template type

endless-sky commented 6 years ago

Commit 5f31551 should fix that.

kaiser-dg commented 6 years ago

Thank you!