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 - Compile error when disabling SDL_POWER/SDL_SENSOR due to dynapi
Summary: Compile error when disabling SDL_POWER/SDL_SENSOR due to dynapi
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: build (show other bugs)
Version: 2.0.12
Hardware: x86 Windows 10
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords: target-2.0.14
Depends on:
Blocks:
 
Reported: 2020-06-15 09:08 UTC by Dom
Modified: 2020-06-26 21:45 UTC (History)
0 users

See Also:


Attachments
Patch (996 bytes, patch)
2020-06-26 21:10 UTC, Dom
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.