Jump to content

View more

Image of the Day

「筋肉兄貴のスーパーラン!」
夕焼けにガラス・・・(´・ω・`)
ガラスは割りたいでしょうけど、割ったらクリアできないですよ。
(o・ω・o)
 #indiedev  #indiegame #screenshotsaturday https://t.co/fhKO5NJ5ee
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net's newsletters to receive the latest updates and exclusive content.


Sign up now

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

2: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
11 replies to this topic

#1 RudeMatrix   Members   

218
Like
0Likes
Like

Posted 21 August 2009 - 11:03 PM

Hello im trying to use http://wiiyourself.gl.tter.org/, to start programming with the wiimote and i have downloaded the WDK drom msdn 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 305 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 me! I have tried this post on two msdn forums already but had no luck, so im trying good old gamedev! http://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/9aa7cb30-9a96-4fb5-9b3d-427e73159cce/

#2 adeyblue   Members   

537
Like
0Likes
Like

Posted 22 August 2009 - 06:41 AM

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.

#3 RudeMatrix   Members   

218
Like
0Likes
Like

Posted 22 August 2009 - 09:13 AM

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.

Thank you so much for your reply and anymore help you can give.

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 2 error C3861: 'SAL_functionClass': identifier not found 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]

#4 adeyblue   Members   

537
Like
0Likes
Like

Posted 23 August 2009 - 08:11 AM

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.

#5 RudeMatrix   Members   

218
Like
0Likes
Like

Posted 23 August 2009 - 10:04 AM

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.


current VS settings

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

#6 adeyblue   Members   

537
Like
0Likes
Like

Posted 24 August 2009 - 08:27 AM

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.

#7 RudeMatrix   Members   

218
Like
0Likes
Like

Posted 25 August 2009 - 04:25 AM

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


#8 RudeMatrix   Members   

218
Like
0Likes
Like

Posted 03 September 2009 - 01:32 AM

hello again, i refigured my tool options:

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 2 error C3861: 'SAL_functionClass': identifier not found 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 5 error C3861: 'SAL_acquire': identifier not found 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
Error 8 error C3861: 'SAL_release': identifier not found 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
"

#9 RudeMatrix   Members   

218
Like
0Likes
Like

Posted 21 September 2009 - 06:49 AM

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

#10 adeyblue   Members   

537
Like
0Likes
Like

Posted 22 September 2009 - 05:18 AM

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.

#11 maddot   Members   

122
Like
0Likes
Like

Posted 02 October 2009 - 01:38 PM

i'm confused, what's this MSDN SDK? is it the Windows SDK(http://msdn.microsoft.com/en-us/windows/bb980924.aspx)?

#12 Charlles   Members   

100
Like
0Likes
Like

Posted 06 October 2009 - 06:38 AM

Hi.. please i have the same problem that you had....
Help me... send me the steps... what do you install first, second an last please..
it is for my thesis im very stressed...
my mail is charllesky@hotmail.com if you want send me something... or in the case send me the project please...!! :)




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.