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 2627

Summary: SDL fails to link on non-Windows systems since the recent changes to its Windows XInput code
Product: SDL Reporter: Alex Szpakowski <amaranth72>
Component: joystickAssignee: Sam Lantinga <slouken>
Status: VERIFIED FIXED QA Contact: Sam Lantinga <slouken>
Severity: critical    
Priority: P2 CC: aschiffler, binarycrusader, mathstuf
Version: HG 2.0   
Hardware: All   
OS: All   
Attachments: Adds SDL_FALSE impl for all other platforms

Description Alex Szpakowski 2014-07-04 23:18:07 UTC
Since this commit: https://hg.libsdl.org/SDL/rev/dfc759d7486f , SDL fails to link when building on operating systems which don't define a SDL_SYS_IsXInputGamepad_DeviceIndex function (non-Windows systems.)

This is because SDL_PrivateGetControllerMapping ( https://hg.libsdl.org/SDL/file/47fb6a7e7f68/src/joystick/SDL_gamecontroller.c#l256 ) calls that system-specific function on all operating systems, even though it's only defined in Windows.
Comment 1 Ben Boeckel 2014-07-06 03:46:10 UTC
Created attachment 1737 [details]
Adds SDL_FALSE impl for all other platforms

Here's a patch which implements all non-Windows platforms with an SDL_FALSE function. Tested with an Android build.
Comment 2 Andreas Schiffler 2014-07-07 03:16:37 UTC
Occurs also on Windows cygwin builds.

$ ../configure --disable-haptic --disable-joystick
...
SDL2 Configure Summary:
Building Shared Libraries
Building Static Libraries
Enabled modules : atomic audio video render events power filesystem threads timers file loadso cpuinfo assembly
Assembly Math   : mmx 3dnow sse
Audio drivers   : disk dummy directx
Video drivers   : dummy opengl directx
Input drivers   :
Using libudev   : NO
Using dbus      : NO
Using ibus      : NO


$ make

#(cd /cygdrive/i/Sources/SDL && sh autogen.sh && sh configure)
/bin/sh ../build-scripts/updaterev.sh
...
build/.libs/SDL_gamecontroller.o: In function `SDL_PrivateGetControllerMapping':
/cygdrive/i/Sources/SDL/src/joystick/SDL_gamecontroller.c:261: undefined reference to `SDL_SYS_IsXInputGamepad_DeviceIndex'
/cygdrive/i/Sources/SDL/src/joystick/SDL_gamecontroller.c:261: undefined reference to `SDL_SYS_IsXInputGamepad_DeviceIndex'
/cygdrive/i/Sources/SDL/src/joystick/SDL_gamecontroller.c:261: undefined reference to `SDL_SYS_IsXInputGamepad_DeviceIndex'
/cygdrive/i/Sources/SDL/src/joystick/SDL_gamecontroller.c:261: undefined reference to `SDL_SYS_IsXInputGamepad_DeviceIndex'
/cygdrive/i/Sources/SDL/src/joystick/SDL_gamecontroller.c:261: undefined reference to `SDL_SYS_IsXInputGamepad_DeviceIndex'
build/.libs/SDL_gamecontroller.o:/cygdrive/i/Sources/SDL/src/joystick/SDL_gamecontroller.c:261: more undefined references to `SDL_SYS_IsXInputGamepad_DeviceIndex' follow
collect2: error: ld returned 1 exit status
Makefile:141: recipe for target 'build/libSDL2.la' failed
make: *** [build/libSDL2.la] Error 1
Comment 3 Sam Lantinga 2014-07-07 17:27:12 UTC
This is fixed, thanks!
https://hg.libsdl.org/SDL/rev/1a5d959d7b32
Comment 4 Andreas Schiffler 2014-07-08 06:49:21 UTC
Win7/cygwin builds fine now.