Skip to content

Commit

Permalink
Fixed bug 3138 - c_dfDIJoystick2 already defined in dinput8.lib
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
slouken committed Oct 1, 2016
1 parent da6197c commit 64180d2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/joystick/windows/SDL_dinputjoystick.c
Expand Up @@ -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,
Expand Down

0 comments on commit 64180d2

Please sign in to comment.