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 1739 - Can't build on MinGW (32) with Joystick and Haptic
Summary: Can't build on MinGW (32) with Joystick and Haptic
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: joystick (show other bugs)
Version: HG 2.0
Hardware: x86 Windows 7
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords: target-2.0.0
Depends on:
Blocks:
 
Reported: 2013-03-02 18:39 UTC by Mike Kasprzak
Modified: 2013-11-03 19:15 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Kasprzak 2013-03-02 18:39:42 UTC
Hey,

Despite what the build bot says,

http://buildbot.libsdl.org/one_line_per_build

I've been unable to build HG SDL on MinGW (MinGW32 with MSys) with Joystick support for a few months now. I've ignored it since 360 controller support was in progress, but I imagine that's done now.

The culprit is joystick/windows/SDL_dxjoystick_c.h asking for:

#include <wbemcli.h>

and

#include <xinput.h>

Neither of which are available with MinGW's headers (at least not MinGW 32's).

Doing a "./configure --disable-joystick --disable-haptic" works fine.


This may or may not be related, but does building SDL on MinGW now require one of the Windows Platform SDK's to be available? As far as I know, that's the only way for MinGW to get those headers. 

An experiment way back I was able to use Xinput.h and Xinput.lib with MinGW, but I'm not sure what wbemcli.h is used for.
Comment 1 Gabriel Jacobo 2013-03-05 07:53:26 UTC
What version of Mingw do you use and which platform? I compile SDL2 with Ubuntu 12.04 and AFAICT joystick support works fine.

dpkg -S wbemcli
mingw-w64-dev: /usr/i686-w64-mingw32/include/wbemcli.h
mingw-w64-dev: /usr/x86_64-w64-mingw32/include/wbemcli.h

dpkg -S xinput.h
mingw-w64-dev: /usr/x86_64-w64-mingw32/include/xinput.h
mingw-w64-dev: /usr/i686-w64-mingw32/include/xinput.h
Comment 2 Mike Kasprzak 2013-03-05 18:59:01 UTC
MinGW on Windows 7. The one here that comes with MSys.

http://www.mingw.org

MinGW64 is a separate/different project.
Comment 3 Gabriel Jacobo 2013-03-05 19:09:34 UTC
Take a look here: http://buildbot.libsdl.org/builders/sdl-mingw-x86/builds/775/steps/configure/logs/stdio

From that log, a suggestion that occurred to me is to make sure that the environment variable DXSDK_DIR is set properly, that may do the trick in your case (assuming you have the Platform SDK and DirectX SDK installed).
Comment 4 Mike Kasprzak 2013-03-05 19:35:35 UTC
Okay, good to know. I can certainly work around this for myself, but I want to mention older SDL builds did not require the DirectX/Platform SDK to be installed at all. The libraries shipped alongside MinGW were adequate (and do work for everything except the new Joystick code).
Comment 5 Gabriel Jacobo 2013-03-05 19:51:35 UTC
If Mingw32 is providing those headers, and SDL is failing to include them, then it's something we can fix (we are probably missing some include path somewhere). If Mingw32 is not providing them, then there's no way around it but having the Platform and DirectX SDKs installed (in which case we should have a note in the README somewhere, and the joystick system could be disabled with a test in the configure script). If you can work a patch for that I'll review it.
Comment 6 Ryan C. Gordon 2013-07-12 12:22:11 UTC
To be clear, if the headers aren't available and the configure script didn't disable these subsystems (or we fail to check for it at all), that's a bug and we should fix it, regardless of what MingW makes available.

--ryan.
Comment 7 Ryan C. Gordon 2013-07-12 22:15:58 UTC
(Sorry if you get a lot of copies of this email, we're touching dozens of bug reports right now.)

Tagging a bunch of bugs as target-2.0.0, Priority 2.

This means we're in the final stretch for an official SDL 2.0.0 release! These are the bugs we really want to fix before shipping if humanly possible.

That being said, we don't promise to fix them because of this tag, we just want to make sure we don't forget to deal with them before we bless a final 2.0.0 release, and generally be organized about what we're aiming to ship.

Hopefully you'll hear more about this bug soon. If you have more information (including "this got fixed at some point, nevermind"), we would love to have you come add more information to the bug report when you have a moment.

Thanks!
--ryan.
Comment 8 Nathaniel J Fries 2013-08-27 06:04:09 UTC
This bug still exists as of revision 7700.
Comment 9 Robert Norris 2013-09-28 23:33:45 UTC
This trivial patch is what I sent to MXE[1] to get it building. I have no way of knowing if the alternate SDL_mmjoystick actually works though. A successful build is all I needed for now.


--- a/configure.in	Sat Sep 14 11:25:52 2013 -0700
+++ b/configure.in	Fri Sep 27 15:03:58 2013 +1000
@@ -2127,7 +2127,7 @@
         # FIXME: latest Cygwin finds dinput headers, but we die on other win32 headers.
         # FIXME:  ...so force it off for now.
         case "$host" in
-            *-*-cygwin*)
+            *-*-cygwin* | *-*-mingw32*)
             have_dinput=false
             ;;
         esac


1. https://github.com/mxe/mxe/pull/247
Comment 10 Sam Lantinga 2013-10-18 06:06:54 UTC
You can now build SDL with MinGW and it will correctly not build the haptic support, and will build the winmm joystick driver.
Comment 11 Mike Kasprzak 2013-11-02 18:42:48 UTC
Great! Yes it works now. Thanks again.
Comment 12 Sam Lantinga 2013-11-03 19:15:29 UTC
No problem! :)