Original Post
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