From b5ff4dccdd155280f391f6390189c880dba469a5 Mon Sep 17 00:00:00 2001 From: Taiko Date: Wed, 1 Apr 2020 18:59:40 +0200 Subject: [PATCH] fixed compiler and runtime error on recent versions of Qt --- src/globalvariables.h | 2 ++ src/main.cpp | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/globalvariables.h b/src/globalvariables.h index 58a79d4..e646950 100644 --- a/src/globalvariables.h +++ b/src/globalvariables.h @@ -1,7 +1,9 @@ #ifndef __GLOBALVARIABLES_H__ #define __GLOBALVARIABLES_H__ +#include #include +#include // all variables here must be const else linker errors will occur diff --git a/src/main.cpp b/src/main.cpp index d882fb8..99188c8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -15,13 +15,15 @@ int main(int argc, char ** argv) { - QApplication app( argc, argv ); - // crashes when trying to use ANGLE and opengl driver might not be available #ifdef Q_OS_WIN - QCoreApplication::setAttribute(Qt::AA_UseSoftwareOpenGL); + QCoreApplication::setAttribute(Qt::AA_UseSoftwareOpenGL); #endif + QApplication app( argc, argv ); + + + app.setQuitOnLastWindowClosed(false); app.setApplicationName("TAsteroids");