diff --git a/src/main.cc b/src/main.cc index 02be68a9c4c615af8bd37c26f29d164cadd5c3db..6a7952479d9c1d591fd585f4057063c40920b995 100644 --- a/src/main.cc +++ b/src/main.cc @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -222,7 +223,12 @@ int main(int argc, char *argv[]) #ifndef __mobile__ RunGuard guard("QGroundControlRunGuardKey"); if (!guard.tryToRun()) { - return 0; + // QApplication is necessary to use QMessageBox + QApplication errorApp(argc, argv); + QMessageBox::critical(nullptr, QObject::tr("Error"), + QObject::tr("A second instance of QGroundControl is already running. Please close the other instance and try again.") + ); + return -1; } #endif