#3138 closed defect (fixed)
[PATCH] SDL 2.0.4 devel version breaks Windows build
Reported by: | historic_bruno | Owned by: | historic_bruno |
---|---|---|---|
Priority: | Should Have | Milestone: | Alpha 20 |
Component: | Core engine | Keywords: | patch |
Cc: | Patch: |
Description
I tested the latest SDL 2.0.4 dev copy from Hg, and there are various Windows build errors related to the main()
function. For one thing, we no longer need to define a wmain()
function to convert cl arguments to UTF-8, SDL2 does that. Then, the test suite is broken:
1>------ Build started: Project: test, Configuration: Release Win32 ------ 1> test_root.cpp 1>SDL2main.lib(SDL_windows_main.obj) : error LNK2005: _main already defined in test_root.obj 1> Creating library ..\..\..\binaries\system\test.lib and object ..\..\..\binaries\system\test.exp 1>SDL2main.lib(SDL_windows_main.obj) : error LNK2019: unresolved external symbol _SDL_main referenced in function _main_utf8 1>..\..\..\binaries\system\test.exe : fatal error LNK1120: 1 unresolved externals
I was able to fix this by manually adding #include "lib/external_libraries/libsdl.h"
to test_root.cpp, but I don't know how that file is generated or if this might break older SDL versions.
Attachments (2)
Change History (12)
by , 9 years ago
Attachment: | wseh.cpp.patch added |
---|
by , 9 years ago
Attachment: | sdl2.0.4-win-fixes.patch added |
---|
comment:1 by , 9 years ago
comment:2 by , 9 years ago
I guess we could also remove the MAIN_STARTUP define now (I really think we should just rip ICC related code out since it hasn't been tested in years and likely is broken, but that would be another ticket). Apart from that the patch looks good.
comment:3 by , 9 years ago
Cc: | removed |
---|---|
Keywords: | review removed |
Owner: | set to |
Status: | new → assigned |
comment:5 by , 9 years ago
Note this isn't needed unless we update to SDL 2.0.4 (currently RC), so we can push it to A20 if that doesn't happen.
comment:6 by , 9 years ago
Milestone: | Alpha 19 → Alpha 20 |
---|
comment:7 by , 8 years ago
SDL 2.0.4 was released: http://lists.libsdl.org/pipermail/sdl-libsdl.org/2016-January/097625.html.
leper pointed me in the right direction for the tests error, I needed to add an include in premake4.lua. The new patch has a little more cleanup for wseh.cpp.