Skip to main content
gamedev.net
🔒 Locked

Direct Input Problems

Started by Aradin 1 reply 250+ views
Original Post
Aradin
Aradin
Hello, I am currently working my way through learning Direct X and have been working on DirectInput however I cannot get any of my programs that use it to work for some reason. I am using the Direct X 9.0b SDK but the following line of code keeps giving me the same three errors. The problem is at the very beginning of my code so I will provide it all up to the problem point #include <windows.h> #include <stdio.h> #include <dinput.h> #include "resource.h" // Application variables //////////////////////// HWND g_hWnd; // Window handle char g_szClass[] = "MouseDemo"; // Class name This here is the line that is giving the errors: IDirectInput8 *g_pDI; // DirectInput component And here are the errors: C2143: syntax error : missing '';'' before ''*'' C2501:''IDirectInput8'' : missing storage-class or type specifiers C2501: ''g_pDI'' : missing storage-class or type specifiers I get these errors in every program I have tried that uses DirectInput I even tried the samples that are provided with DirectX itself but they won''t compile either. I am including dinput.h and linking dinput8.lib and dxgiud.lib So I have no clue why this won''t work and help would be greatly appreciated Thanks
Nik02
Nik02
Have you setup the include and lib paths so that the new sdk paths are topmost on the list?
The reason for error may be that the compiler looks at wrong version of dinput.h...

-Nik

Also, I assume "dxgiud.lib" is a typo in your post, instead of in your project :D

[edited by - Nik02 on January 20, 2004 3:22:32 PM]
Niko Suni
Aradin
Aradin
Yes it was a typo and thanks it is working fine now, I have the directories set but they were at the bottom of the list not the top so I moved them up and they are working find now, thanks alot

Aradin

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.