We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 5193

Summary: Compile error when disabling SDL_POWER/SDL_SENSOR due to dynapi
Product: SDL Reporter: Dom <stfx>
Component: buildAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 Keywords: target-2.0.14
Version: 2.0.12   
Hardware: x86   
OS: Windows 10   
Attachments: Patch

Description Dom 2020-06-15 09:08:56 UTC
SDL 2.0.12/2.0.13 fails to compile on Visual Studio 2019 when disabling SDL_POWER or SDL_SENSOR in cmake even if they are unused:

LNK2019	unresolved external symbol _SDL_GetPowerInfo_REAL referenced in function _initialize_jumptable

If dynapi is manually disabled in SDL_dynapi.h (#define SDL_DYNAMIC_API 0) everything compiles fine.

Is this by design since other features used in dynapi such as SDL_LOCALE can be disabled without issue?
Comment 1 Ryan C. Gordon 2020-06-26 19:09:14 UTC
This is fixed in https://hg.libsdl.org/SDL/rev/2fabbbee604c

--ryan.
Comment 2 Dom 2020-06-26 21:10:05 UTC
Created attachment 4397 [details]
Patch

Thanks, similarly the following should also fix building with -DSDL_SENSOR=Off
Comment 3 Ryan C. Gordon 2020-06-26 21:45:39 UTC
Whoops, yes, I only did half of the work.  :)

Good catch, your patch is now https://hg.libsdl.org/SDL/rev/f1a59a78dcec

--ryan.