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 - c_dfDIJoystick2 already defined in dinput8.lib
Summary: c_dfDIJoystick2 already defined in dinput8.lib
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: joystick (show other bugs)
Version: 2.0.3
Hardware: x86_64 Windows 7
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-07 14:37 UTC by Machiel van Hooren
Modified: 2016-10-01 21:05 UTC (History)
0 users

See Also:


Attachments

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