diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index dc2888ace..08e9fe3e3 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -852,6 +852,9 @@ Settings MainWindow::getCppcheckSettings() Settings result; + const QString applicationFilePath = QCoreApplication::applicationFilePath(); + result.exename = applicationFilePath.toStdString(); + const bool std = tryLoadLibrary(&result.library, "std.cfg"); bool posix = true; if (result.posix()) diff --git a/lib/cppcheck.cpp b/lib/cppcheck.cpp index 2b99f7241..6554198c6 100644 --- a/lib/cppcheck.cpp +++ b/lib/cppcheck.cpp @@ -133,7 +133,7 @@ namespace { if (obj.count("executable")) { if (!obj["executable"].is()) return "Loading " + fileName + " failed. executable must be a string."; - executable = getFullPath(obj["executable"].get(), exename); + executable = getFullPath(obj["executable"].get(), fileName); return ""; }