diff --git a/Source/Core/DolphinQt/Main.cpp b/Source/Core/DolphinQt/Main.cpp index 3420a0a886..945912dea7 100644 --- a/Source/Core/DolphinQt/Main.cpp +++ b/Source/Core/DolphinQt/Main.cpp @@ -99,11 +99,12 @@ static bool QtMsgAlertHandler(const char* caption, const char* text, bool yes_no return false; } -// N.B. On Windows, this should be called from WinMain. Link against qtmain and specify -// /SubSystem:Windows +#ifndef _WIN32 int main(int argc, char* argv[]) { -#ifdef _WIN32 +#else +int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PWSTR pCmdLine, int nCmdShow) +{ std::vector utf8_args = CommandLineToUtf8Argv(GetCommandLineW()); const int utf8_argc = static_cast(utf8_args.size()); std::vector utf8_argv(utf8_args.size()); @@ -146,7 +147,11 @@ int main(int argc, char* argv[]) QCoreApplication::setOrganizationDomain(QStringLiteral("dolphin-emu.org")); QCoreApplication::setApplicationName(QStringLiteral("dolphin-emu")); +#ifdef _WIN32 + QApplication app(__argc, __argv); +#else QApplication app(argc, argv); +#endif #ifdef _WIN32 // On Windows, Qt 5's default system font (MS Shell Dlg 2) is outdated. diff --git a/Source/VSProps/QtCompile.props b/Source/VSProps/QtCompile.props index 107f176795..0ad24e61ad 100644 --- a/Source/VSProps/QtCompile.props +++ b/Source/VSProps/QtCompile.props @@ -35,7 +35,7 @@ $(QtLibDir);%(AdditionalLibraryDirectories) - qtmain$(QtLibSuffix).lib;Qt5Core$(QtLibSuffix).lib;Qt5Gui$(QtLibSuffix).lib;Qt5Widgets$(QtLibSuffix).lib;%(AdditionalDependencies) + Qt5Core$(QtLibSuffix).lib;Qt5Gui$(QtLibSuffix).lib;Qt5Widgets$(QtLibSuffix).lib;%(AdditionalDependencies) Windows