From d870f2719bcf4f237b11a160129c1226fe202346 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 1 Oct 2016 12:31:31 -0700 Subject: [PATCH] Fixed bug 3320 - SDL_windows_main.c defines both console application entry points Simon Hug The SDLmain file src/main/windows/SDL_windows_main.c defines both entry points for console applications, main and wmain. This seems to confuse MSVC. It outputs a LNK4067 warning and then chooses main, which is a shame because only wmain has the unicode handling. Using SDLmain.lib provided on libsdl.org, the linker also goes for main. I'm proposing to not define the main entry point at all. wmain should be supported well enough with MSVC. --- src/main/windows/SDL_windows_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/windows/SDL_windows_main.c b/src/main/windows/SDL_windows_main.c index 67ef98e6c..596ef531f 100644 --- a/src/main/windows/SDL_windows_main.c +++ b/src/main/windows/SDL_windows_main.c @@ -110,9 +110,10 @@ OutOfMemory(void) #if defined(_MSC_VER) /* The VC++ compiler needs main/wmain defined */ -# define console_ansi_main main # if UNICODE # define console_wmain wmain +# else +# define console_ansi_main main # endif #endif