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 3138

Summary: c_dfDIJoystick2 already defined in dinput8.lib
Product: SDL Reporter: Machiel van Hooren <machiel>
Component: joystickAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: 2.0.3   
Hardware: x86_64   
OS: Windows 7   

Description Machiel van Hooren 2015-10-07 14:37:35 UTC
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.

Renaming the constant in SDL_dxjoystick.c fixed the problem.

Sounds like the constant was directly copy pasted from some windows source file/header.
Comment 1 Sam Lantinga 2016-10-01 21:05:58 UTC
Fixed, thanks!
https://hg.libsdl.org/SDL/rev/d610af48d2b8