# Trouble with hidpi.h from WDK, trying to use WiiYourself

This topic is 3212 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

##### Share on other sites
Looks like the source annotations in hidpi.h are used without the appropriate headers being directly included, or brought in by other includes you have. Anyhoo, all the undefined bits from those errors you listed live in ddk/wdm.h from the wdk.

Edit:
Maybe your version of the SDK is out of date? I just compiled the code without modification with the WDK from MSDN and the latest version of the SDK.

##### Share on other sites
Thank you so much for your reply, im afraid im still having problems, it should be the most up to date, i downloaded the SDK yesterday and i downloaded and installed WDK at the same time, it is starting to look like perhaps something didnt install correctly or im still missing some form of set up. perhaps this has something to with running windows 7???

i think i shall try downloading the SDK again, are you using the most up to date WDK???

after including the line "#include <ddk/wdm.h>"

making the code:
#include "wiimote.h"#include <sys/types.h>	// for _stat#include <sys/stat.h>	// "#include <process.h>	// for _beginthreadex()#include <wtypes.h>#include <setupapi.h>#include <ddk/wdm.h>extern "C" {# ifdef __MINGW32__#  include <ddk/hidsdi.h>// from WinDDK# else#include <api/hidsdi.h># endif}

it now gives the error:

Error 1 fatal error C1083: Cannot open include file: 'ntdef.h': No such file or directory C:\WinDDK\7600.16385.0\inc\ddk\wdm.h 54

perhaps i need another line in my include directory list, ill start trying that now.

EDIT:

Ok so i re-downloaded the SDK, i still had problems, after putting api/ infront of ntdef.h and in front of a kernelspecs.h i then get this list of errors:

Error 1 error C2144: syntax error : 'char' should be preceded by ')' c:\winddk\7600.16385.0\inc\api\DriverSpecs.h 356
Error 3 error C2059: syntax error : ')' c:\winddk\7600.16385.0\inc\api\DriverSpecs.h 356

i know i shudnt put api/ infront of everything but if i put
C:\WinDDK\7600.16385.0\inc\api
in my include directions then i get this nice list of errors instead:

Error 1 error C2065: '_In_' : undeclared identifier C:\Program Files\Microsoft Visual Studio 9.0\VC\include\excpt.h 60
Error 2 error C2144: syntax error : '_EXCEPTION_RECORD' should be preceded by ')' C:\Program Files\Microsoft Visual Studio 9.0\VC\include\excpt.h 60
Error 3 error C2448: '_except_handler' : function-style initializer appears to be a function definition C:\Program Files\Microsoft Visual Studio 9.0\VC\include\excpt.h 60
Error 4 error C2144: syntax error : 'void' should be preceded by ';' C:\Program Files\Microsoft Visual Studio 9.0\VC\include\excpt.h 61
Error 5 error C2144: syntax error : '_CONTEXT' should be preceded by ';' C:\Program Files\Microsoft Visual Studio 9.0\VC\include\excpt.h 62
Error 6 error C2144: syntax error : 'void' should be preceded by ';' C:\Program Files\Microsoft Visual Studio 9.0\VC\include\excpt.h 63
Error 7 error C2059: syntax error : ')' C:\Program Files\Microsoft Visual Studio 9.0\VC\include\excpt.h 64
Error 8 error C2144: syntax error : 'int' should be preceded by ';' C:\Program Files\Microsoft Visual Studio 9.0\VC\include\ctype.h 94
Error 9 error C2065: '_In_' : undeclared identifier C:\Program Files\Microsoft Visual Studio 9.0\VC\include\ctype.h 94
Error 10 error C2144: syntax error : 'int' should be preceded by ')' C:\Program Files\Microsoft Visual Studio 9.0\VC\include\ctype.h 94
Error 11 error C2448: '_isctype' : function-style initializer appears to be a function definition C:\Program Files\Microsoft Visual Studio 9.0\VC\include\ctype.h 94
Error 12 error C2144: syntax error : 'int' should be preceded by ';' C:\Program Files\Microsoft Visual Studio 9.0\VC\include\ctype.h 94
Error 13 error C2059: syntax error : ')' C:\Program Files\Microsoft Visual Studio 9.0\VC\include\ctype.h 94
Error 14 error C2144: syntax error : 'int' should be preceded by ';' C:\Program Files\Microsoft Visual Studio 9.0\VC\include\ctype.h 95

so i really have no idea what im doing wrong, do you think it could be a windows 7 problem??

[Edited by - ChrisPepper1989 on August 22, 2009 3:13:06 PM]

##### Share on other sites
I rejigged the order of the include directories in VS's settings so that the original VS version of the SDK was at the top, and got exactly the errors you were encountering both with and without wdm.h.

Putting the path to the new SDK first in the list of includes compiles it fine, without wdm.h.

##### Share on other sites
its great to see some progress but im not quite sure what your saying, when you say the original SDK are you talking about DDK? heres an image of my current VS image settings im not really sure what to change around but ill have a rijig and see what happens, i was under the impression it wouldnt make a difference what order those lines were in.

Thank you so much for your help so far i think if you hadnt replied i would have given up on this project by now!

-Chris

##### Share on other sites
Mine looks like this. Depending on what you're planning to do with the library, it might be easier to download mingw and build it with that. The library will be usable from VS projects but you won't be able to set breakpoints in it or do anything else that requires debugging information.

##### Share on other sites
thank u for ur link, i was wondering sbout this line:
"G:\SDK\Include = the new SDK from MSDN"
is that the windows SDK in that case if i moved my line:
\$(WindowsSdkDIR)Include
like you have perhaps it will work :) unforntunatley im not at the machine with my project im using a friends and i'm going away to leeds festival tomorrow for 5 days :( so i won't be able to test this theory out, i will however be doing this first thing when i get back and will update you on how its going. mingw also looks interesting i mite give that a whirl but im not sure why it should work better then VS. When i get things going im hoping to start a game that uses
">head tracking and look into more 3D technologies to try and create a 3D dog fighting game, i was also thinking if the project carries enough weight i might go on to invesigate virtual 3D game technolgy as my disertation this year.

Thanks again for your continuing patience and help with me and my set up problems!!
-Chris

##### Share on other sites
hello again, i refigured my tool options:

and im getting errors in my driver specs .h:
"
Error 1 error C2144: syntax error : 'char' should be preceded by ')' c:\winddk\7600.16385.0\inc\api\DriverSpecs.h 356
Error 3 error C2059: syntax error : ')' c:\winddk\7600.16385.0\inc\api\DriverSpecs.h 356
Error 4 error C2144: syntax error : 'char' should be preceded by ')' c:\winddk\7600.16385.0\inc\api\DriverSpecs.h 374
Error 6 error C2059: syntax error : ')' c:\winddk\7600.16385.0\inc\api\DriverSpecs.h 374
Error 7 error C2144: syntax error : 'char' should be preceded by ')' c:\winddk\7600.16385.0\inc\api\DriverSpecs.h 381
"

and this is with the #include <wdm.h>, without it i get all the errors in hidpi:

"Error 37 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\winddk\7600.16385.0\inc\api\hidpi.h 424
Error 38 error C2086: 'int NTSTATUS' : redefinition c:\winddk\7600.16385.0\inc\api\hidpi.h 424
Error 39 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\winddk\7600.16385.0\inc\api\hidpi.h 433
Error 40 error C2065: 'DISPATCH_LEVEL' : undeclared identifier c:\winddk\7600.16385.0\inc\api\hidpi.h 488
Error 41 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\winddk\7600.16385.0\inc\api\hidpi.h 489
Error 42 error C2374: '__drv_maxIRQL' : redefinition; multiple initialization c:\winddk\7600.16385.0\inc\api\hidpi.h 489
Error 43 error C2146: syntax error : missing ';' before identifier 'NTSTATUS' c:\winddk\7600.16385.0\inc\api\hidpi.h 489
Error 44 error C2143: syntax error : missing ';' before '__stdcall' c:\winddk\7600.16385.0\inc\api\hidpi.h 489
Error 45 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\winddk\7600.16385.0\inc\api\hidpi.h 489
Error 46 error C2086: 'int NTSTATUS' : redefinition c:\winddk\7600.16385.0\inc\api\hidpi.h 489
Error 47 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\winddk\7600.16385.0\inc\api\hidpi.h 495
"

##### Share on other sites
I solved my problem, after studying your set up adeyblue, i realised that the major difference was the fact that i didnt have the MSDN SDK, which i didnt realise the WDK needed to work, to be perfectly honest i had no idea of the MSDN SDK's existence and i find it strange that ive never needed the windows SDK before when ive used windows programing to set up OpenGL :S but i supose thats the way in programming when ur still really a noob!

So id like to say a big big thank you to adeyblue for putting up with me and providing the all important screen grab, everthings up and running nicely now and im having fun messing around with the wiimote, now i can finally get some work done =]!

Thanks again, Chris

##### Share on other sites
Wow, don't let it ever be said that you're not persistent :) I didn't see any of the followup posts since my last response but congrats on solving it. Here's hoping that using it isn't half as painful as setting it up.

1. 1
2. 2
3. 3
Rutin
19
4. 4
5. 5

• 10
• 14
• 30
• 13
• 11
• ### Forum Statistics

• Total Topics
631782
• Total Posts
3002338
×