# WinJoystickMex for 64 bit Windows?

**URL:** <https://psychtoolbox.discourse.group/t/winjoystickmex-for-64-bit-windows/640>\
**Category:** Uncategorized\
**Created:** [June 5, 2013, 8:30am UTC](https://psychtoolbox.discourse.group/t/winjoystickmex-for-64-bit-windows/640 "2013-06-05T08:30:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![adwkiwi](https://avatars.discourse-cdn.com/v4/letter/a/839c29/32.png) [@adwkiwi](https://psychtoolbox.discourse.group/u/adwkiwi)\
**Post date:** [June 5, 2013, 8:30am UTC](https://psychtoolbox.discourse.group/t/winjoystickmex-for-64-bit-windows/640/1 "2013-06-05T08:30:43Z")

</div>

I just tried using this mex file on a 64 bit Win7 machine and I'm getting an 'undefined function' error even though the mex is in the pwd. My guess is that it's because I have a .mexw32 file; is there any chance of a version compiled for 64 bit?  
  
Thanks  
-andrew

---

<div class="post-metadata">

**Author:** ![adwkiwi](https://avatars.discourse-cdn.com/v4/letter/a/839c29/32.png) [@adwkiwi](https://psychtoolbox.discourse.group/u/adwkiwi)\
**Post date:** [June 8, 2013, 12:17pm UTC](https://psychtoolbox.discourse.group/t/winjoystickmex-for-64-bit-windows/640/2 "2013-06-08T12:17:16Z")

</div>

The main reason I haven't compiled it myself is that I don't know how. I know very little about C, hence asking for help!  
  
I'll check that other implementation.  
-andrew  
  

> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), Matthew Edmundson \<medmunds@...\> wrote:  
> \>  
> \> My first thought would be to compile it yourself, but there must be some  
> \> non-trivial reason why this hasn't already been done. Mario obviously will  
> \> know. For kicks the other day, I tried compiling it myself on the 32-bit  
> \> side using the compile string that is provided in the header of  
> \> WinJoystickMex.c, but the compiler couldn't find the JOYINFO structure, so  
> \> it wouldn't compile. The following is the line from the header that I used,  
> \> in MATLAB 2012b, but apparently it still can't find the library where  
> \> JOYINFO is included:  
> \>   
> \> mex -v -g WinJoystickMex.c winmm.lib  
> \>   
> \> Anyway, our project actually needs more than four buttons, and JOYINFO is  
> \> limited to four, so we've had to go with a DirectInput implementation,  
> \> instead, choosing from one of the following, which also happen to have w64  
> \> mex files:  
> \> [http://www.mathworks.com/matlabcentral/linkexchange/?term=tag%3A%22gamepad%22](http://www.mathworks.com/matlabcentral/linkexchange/?term=tag%3A%22gamepad%22)  
> \>   
> \>   
> \> Best,  
> \> Matthew  
> \>   
> \>   
> \> On Wed, Jun 5, 2013 at 4:30 AM, adwkiwi \<adwkiwi@...\> wrote:  
> \>   
> \> \> \*\*  
> \> \>  
> \> \>  
> \> \> I just tried using this mex file on a 64 bit Win7 machine and I'm getting  
> \> \> an 'undefined function' error even though the mex is in the pwd. My guess  
> \> \> is that it's because I have a .mexw32 file; is there any chance of a  
> \> \> version compiled for 64 bit?  
> \> \>  
> \> \> Thanks  
> \> \> -andrew  
> \> \>  
> \> \>   
> \> \>  
> \>

---

<div class="post-metadata">

**Author:** ![mariokleiner](https://avatars.discourse-cdn.com/v4/letter/m/13edae/32.png) [@mariokleiner](https://psychtoolbox.discourse.group/u/mariokleiner)\
**Post date:** [June 8, 2013, 2:16pm UTC](https://psychtoolbox.discourse.group/t/winjoystickmex-for-64-bit-windows/640/3 "2013-06-08T14:16:31Z")

</div>

WinJoystickMex.mexw64 for 64-Bit Matlab on 64-Bit Windows is part of PTB since the PTB beta from 15.09.2012. I just tried it on Windows-7 with R2012a and it works for me.  
  
Is your ptb beta up to date?  
-mario  
  

> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "adwkiwi" \<adwkiwi@...\> wrote:  
> \>  
> \> The main reason I haven't compiled it myself is that I don't know how. I know very little about C, hence asking for help!  
> \>   
> \> I'll check that other implementation.  
> \> -andrew  
> \>   
> \> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), Matthew Edmundson \<medmunds@\> wrote:  
> \> \>  
> \> \> My first thought would be to compile it yourself, but there must be some  
> \> \> non-trivial reason why this hasn't already been done. Mario obviously will  
> \> \> know. For kicks the other day, I tried compiling it myself on the 32-bit  
> \> \> side using the compile string that is provided in the header of  
> \> \> WinJoystickMex.c, but the compiler couldn't find the JOYINFO structure, so  
> \> \> it wouldn't compile. The following is the line from the header that I used,  
> \> \> in MATLAB 2012b, but apparently it still can't find the library where  
> \> \> JOYINFO is included:  
> \> \>   
> \> \> mex -v -g WinJoystickMex.c winmm.lib  
> \> \>   
> \> \> Anyway, our project actually needs more than four buttons, and JOYINFO is  
> \> \> limited to four, so we've had to go with a DirectInput implementation,  
> \> \> instead, choosing from one of the following, which also happen to have w64  
> \> \> mex files:  
> \> \> [http://www.mathworks.com/matlabcentral/linkexchange/?term=tag%3A%22gamepad%22](http://www.mathworks.com/matlabcentral/linkexchange/?term=tag%3A%22gamepad%22)  
> \> \>   
> \> \>   
> \> \> Best,  
> \> \> Matthew  
> \> \>   
> \> \>   
> \> \> On Wed, Jun 5, 2013 at 4:30 AM, adwkiwi \<adwkiwi@\> wrote:  
> \> \>   
> \> \> \> \*\*  
> \> \> \>  
> \> \> \>  
> \> \> \> I just tried using this mex file on a 64 bit Win7 machine and I'm getting  
> \> \> \> an 'undefined function' error even though the mex is in the pwd. My guess  
> \> \> \> is that it's because I have a .mexw32 file; is there any chance of a  
> \> \> \> version compiled for 64 bit?  
> \> \> \>  
> \> \> \> Thanks  
> \> \> \> -andrew  
> \> \> \>  
> \> \> \>   
> \> \> \>  
> \> \>  
> \>

---

<div class="post-metadata">

**Author:** ![adwkiwi](https://avatars.discourse-cdn.com/v4/letter/a/839c29/32.png) [@adwkiwi](https://psychtoolbox.discourse.group/u/adwkiwi)\
**Post date:** [June 10, 2013, 12:47pm UTC](https://psychtoolbox.discourse.group/t/winjoystickmex-for-64-bit-windows/640/4 "2013-06-10T12:47:54Z")

</div>

I'll check (not my machine). Thanks though, if it's working on yours then it should eventually work on this one. The 32/64 bit issue was just a guess anyway!  
-andrew  
  

> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "Mario" \<mario.kleiner@...\> wrote:  
> \>  
> \>   
> \>   
> \> WinJoystickMex.mexw64 for 64-Bit Matlab on 64-Bit Windows is part of PTB since the PTB beta from 15.09.2012. I just tried it on Windows-7 with R2012a and it works for me.  
> \>   
> \> Is your ptb beta up to date?  
> \> -mario
