From 64180d226146013845f9280dd054ff82dfd68ed4 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 1 Oct 2016 14:05:35 -0700 Subject: [PATCH] Fixed bug 3138 - c_dfDIJoystick2 already defined in dinput8.lib Machiel van Hooren In SDL_dxjoystick.c line 349 there is a constant c_dfDIJoystick2. However, this constant is aparently also defined in dinput8.lib. I encountered a linking error when statically linking to SDL: SDL2_static.lib(SDL_dxjoystick.obj) : error LNK2005: _c_dfDIJoystick2 already defined in dinput8.lib My application is also linking to dinput8.lib because we rolled our own joystick input and are not using the joystick functionality from SDL. --- src/joystick/windows/SDL_dinputjoystick.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/joystick/windows/SDL_dinputjoystick.c b/src/joystick/windows/SDL_dinputjoystick.c index 47e086121..14df6527c 100644 --- a/src/joystick/windows/SDL_dinputjoystick.c +++ b/src/joystick/windows/SDL_dinputjoystick.c @@ -214,7 +214,7 @@ static DIOBJECTDATAFORMAT dfDIJoystick2[] = { { &GUID_Slider, FIELD_OFFSET(DIJOYSTATE2, rglFSlider[1]), DIDFT_OPTIONAL | DIDFT_AXIS | DIDFT_ANYINSTANCE, 0 }, }; -const DIDATAFORMAT c_dfDIJoystick2 = { +static const DIDATAFORMAT c_dfDIJoystick2 = { sizeof(DIDATAFORMAT), sizeof(DIOBJECTDATAFORMAT), DIDF_ABSAXIS,