diff --git a/compiler.cpp b/compiler.cpp index d66c5f2..7885d68 100644 --- a/compiler.cpp +++ b/compiler.cpp @@ -54,12 +54,22 @@ QString Compiler::cxx() } #endif } else { +#ifdef Q_OS_WIN + QFileInfo fi(compiler); + if (!fi.isAbsolute()) { + compiler = searchPath(compiler); + } +#else // check path compiler = searchPath(compiler); +#endif } if (compiler.isEmpty()) { qCritical() << "Compiler not found." << conf->value("CXX").toString().trimmed(); +#ifdef Q_OS_WIN + qCritical() << "Remember to call vcvarsall.bat to complete environment setup."; +#endif std::exit(1); } diff --git a/main.cpp b/main.cpp index 9a59ec9..88b717e 100644 --- a/main.cpp +++ b/main.cpp @@ -386,6 +386,9 @@ int main(int argv, char *argc[]) return ret; } + // Check compiler + Compiler::cxx(); + int ret = interpreter(); delete conf; return ret;