From 81304fcafdcddd76a7258ba7be1bc6782f736336 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 25 Sep 2017 19:01:12 +0200 Subject: [PATCH] Fix linking console applications with MinGW in monolithic build Do compile wxEntry(void) overload used in wxIMPLEMENT_WXWIN_MAIN_CONSOLE expansion by non-MSVC compilers under MSW inside the monolithic library too by replacing the "#if !wxUSE_GUI" check guarding it with "#if wxUSE_BASE" one. It's not really clear how could this have ever worked without this fix before, although it apparently did, but stopped with gcc 7. --- src/msw/main.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/msw/main.cpp b/src/msw/main.cpp index 798c3d5457..daaf5e0b9c 100644 --- a/src/msw/main.cpp +++ b/src/msw/main.cpp @@ -305,7 +305,13 @@ WXDLLEXPORT int wxEntry(HINSTANCE hInstance, return wxEntry(wxArgs.argc, wxArgs.argv); } -#else // !wxUSE_GUI +#endif // wxUSE_GUI + +// ---------------------------------------------------------------------------- +// global HINSTANCE +// ---------------------------------------------------------------------------- + +#if wxUSE_BASE int wxEntry() { @@ -314,14 +320,6 @@ int wxEntry() return wxEntry(wxArgs.argc, wxArgs.argv); } -#endif // wxUSE_GUI/!wxUSE_GUI - -// ---------------------------------------------------------------------------- -// global HINSTANCE -// ---------------------------------------------------------------------------- - -#if wxUSE_BASE - HINSTANCE wxhInstance = 0; extern "C" HINSTANCE wxGetInstance()