Trouble with hidpi.h from WDK, trying to use WiiYourself
(too old to reply)
2009-08-21 18:04:01 UTC
Hello im trying to use http://wiiyourself.gl.tter.org/, to start programming
with the wiimote and i have downloaded the WDK to do so, ive set up the demo
in the way the ReadMe told me to however when i compile i get 163 errors in
hidpi. The WiiYourself libary was written for the older DDK but as i can only
seem to get my hands on WDK im trying to use that, the read me says it should
work by simply using a different include path and no other suggestions for
changes are made. From the read me: "You can also use the more recent WinDDK
(although there's no advantage I'm aware of) with include path 'inc/api'."

Here is the snippet of code that includes hidsdi which in turn includes hidpi:

#ifdef _MSC_VER
# pragma warning(disable: 4530)
# pragma comment(lib, "setupapi.lib")
# pragma comment(lib, "hid.lib") // for HID API (from DDK)
# pragma comment(lib, "winmm.lib") // for timeGetTime()

#endif // _MSC_VER

#include "wiimote.h"
#include <sys/types.h> // for _stat
#include <sys/stat.h> // "
#include <process.h> // for _beginthreadex()
#include <wtypes.h>
#include <setupapi.h>

extern "C" {

# ifdef __MINGW32__
# include <ddk/hidsdi.h>// from WinDDK
# else
#include <api/hidsdi.h>
# endif

ive tried <api/hidsdi.h> in and out of the extern "C" but it made no
difference, in the original demo code the code was within the extern.

some of the errors include:
Error 1 error C2065: 'PASSIVE_LEVEL' : undeclared identifier
c:\winddk\7600.16385.0\inc\api\hidpi.h 304
Error 2 error C4430: missing type specifier - int assumed. Note: C++
does not support default-int c:\winddk\7600.16385.0\inc\api\hidpi.h 305
Error 3 error C2146: syntax error : missing ';' before identifier
'NTSTATUS' c:\winddk\7600.16385.0\inc\api\hidpi.h 305
Error 4 error C2143: syntax error : missing ';' before '__stdcall'
c:\winddk\7600.16385.0\inc\api\hidpi.h 305
Error 5 error C4430: missing type specifier - int assumed. Note: C++
does not support default-int c:\winddk\7600.16385.0\inc\api\hidpi.h 305
Error 6 error C2377: 'NTSTATUS' : redefinition; typedef cannot be
overloaded with any other symbol c:\winddk\7600.16385.0\inc\api\hidpi.h
Error 7 error C4430: missing type specifier - int assumed. Note: C++
does not support default-int c:\winddk\7600.16385.0\inc\api\hidpi.h 309
Error 8 error C2065: 'DISPATCH_LEVEL' : undeclared identifier
c:\winddk\7600.16385.0\inc\api\hidpi.h 325

and they are all very similar, to me it would seem like there is a header
not being included that should be as all the problems seem to stem from
undefined symbols. however i can't seem to find any information on msdn or in
the WDK documentation that is a relevant information in how hidsdi / hidpi
should be set up and frankly ive been going round in circles and going slowly
insane for the past few hours and im hoping someone can help or give me a
push in the right direction! Thank you in advance for any help you can give

p.s. this post has been moved from
2009-09-11 20:58:01 UTC
I followed your posts in here and game developer as I was having the same
troubles. I was having all the same troubles. This is how I got my code to
compile and build:

WDK version 7600.16385.0
Windows 7 SDK (v7.0)
Visual Studio 2008 (haven't tried Express yet)

Used Jan Axelson's code (usbhidioc)
Ordered and added include files as instructed in gamedev.net. (SDK first and
WDK last)

I didn't add any headers like wdm.h or otherwise to the code, and I didn't
find success until I added the C:\WinDDK\7600.16385.0\lib\wxp\i386 to the end
of VC++ directories->Library Files. I'm assuming that the directory you
choose will be related to OS, as I am building for XP, I used wxp.

I hope this helps you and anybody else struggling with this issue.
2009-09-21 18:01:02 UTC
Hi Husker, thanks for your reply to this thread i had actually discovered a
solution, i didnt have the windows MSDN SDK installed, after looking at
adeyblues (gamedev) set up i decided to install it and order things in the
way he had and everything worked =] i have been busy playing around with the
wii since and havent got round to posting a thank you. I didnt realose that
WDK needed the MSDN SDK to work, it seemed a little odd to me, but owel! now
for some fun with the wiimote!!!

2010-01-13 16:08:01 UTC
What do you mean when you talk about the "MSDN SDK"? I have the exact same
problem, 163 errors in hidpi.h and I've been struggling around for 3 hours
searching for a solution.

Can you post a link to download this sdk?
Sanjeev Sharma
2009-12-19 12:30:01 UTC
The order of header file declarations is:

#include <sal.h> //
#include <sal_supp.h> // These header files just define unimportant macros
in hidsdi.h
#include <driverspecs.h> //

#include <windows.h> // Must be defined before hidsdi.h and setupapi.h

#if defined(__cplusplus)
extern "C" // Just formal requirement

#include <hidsdi.h>

#if defined(__cplusplus)

#include <setupapi.h>

2012-06-24 05:39:08 UTC
Hi, I had same problem, but I have cleared now. Is this toooooo late answer? :)

You try to follow topics If you have intersting to clear this problem yet.